I'm trying to integrate the /admin-ui
functionality in my application, that uses the ServiceStack's built-in ApiKeyAuthProvider, for give the user the possibility to register other users.
In the login page that this functionality renders, when I write my apikey and press the sign in button, through the developer tool console, I see the error "!AuthProvider", that sounds like that the app cannot recoignize the ApiKeyAuthProvider.
This is my AppHost Configure method:
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());
}
Could someone help me please? (ServiceStack v.6.0.2)
Thanks in advance
CodePudding user response:
This issue should be resolved from the latest v6.0.3 pre-release that's now available on MyGet.
If you have an existing ServiceStack v6.0.3 installed you'll need to clear your NuGet packages cache to update to the latest version, e.g:
$ nuget locals all -clear