我正在嘗試/admin-ui在我的應用程式中集成該功能,該功能使用 ServiceStack 的內置 ApiKeyAuthProvider,讓用戶可以注冊其他用戶。
在此功能呈現的登錄頁面中,當我撰寫我的 apikey 并按下登錄按鈕時,通過開發人員工具控制臺,我看到錯誤“!AuthProvider”,聽起來應用程式無法識別 ApiKeyAuthProvider。
這是我的 AppHost 配置方法:
public override void Configure(Container container)
{
//Create and register an OrmLite DB Factory configured to use Live DB by default
var dbFactory = new OrmLiteConnectionFactory(
AppSettings.Get<string>("connString"), SqlServerDialect.Provider);
container.Register<IDbConnectionFactory>(dbFactory);
//Tell ServiceStack you want to persist User Auth Info in SQL Server
container.Register<IAuthRepository>(c => new OrmLiteAuthRepository(c.Resolve<IDbConnectionFactory>()));
container.Resolve<IAuthRepository>().InitSchema();
//Register the AuthFeature with the API Key Auth Provider
Plugins.Add(new AuthFeature(() => new AuthUserSession(),
new IAuthProvider[] {
new ApiKeyAuthProvider(AppSettings)
}));
Plugins.Add(new AdminUsersFeature());
}
有人可以幫我嗎?(ServiceStack v.6.0.2)
提前致謝
編輯:


uj5u.com熱心網友回復:
此問題應從 MyGet 上現在可用的最新 v6.0.3 預發行版中得到解決。
如果您安裝了現有的 ServiceStack v6.0.3,則需要清除 NuGet 包快取以更新到最新版本,例如:
$ nuget locals all -clear
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/430387.html
標籤:asp.net-mvc 服务栈
