Here is my auth config
Plugins.Add(new AuthFeature(() => new AuthUserSession(), new IAuthProvider[] {
new ApiKeyAuthProvider(AppSettings) { RequireSecureConnection = false, InitSchema = true},
new CredentialsAuthProvider(AppSettings)
})
{
IncludeRegistrationService = true,
});
container.Register<IAuthRepository>(c => new OrmLiteAuthRepository(dbFactory));
container.Resolve<IAuthRepository>().InitSchema();
When trying to resolve the dependency of IManageApiKeys in service, it throws an exception. Cannot cast an object of type "ServiceStack.Auth.OrmLiteAuthRepository" to type "ServiceStack.Auth.IManageApiKeys
var apiRepo = (IManageApiKeys)base.TryResolve<IAuthRepository>();
I cannot figure out how to resolve the IManageApiKeys dependency, and it does not create the ApiKey table via InitSchema (), however, UserAuth, UserAuthDetails and UserAuthRole are created.
source
share