I am new to IdentityServer and am having a little trouble setting this up.
For reasons I won't go into here I can't use ASP.NET Identity or EntityFramework. I have a custom database for users that I need to authenticate against so I took the samples and tried to switch out the InMemoryUsers for a custom persistence store.
Here is my ConfigureServices method:
public void ConfigureServices(IServiceCollection services)
{
services.AddIdentityServer(options =>
{
options.AuthenticationOptions = new IdentityServer4.Configuration.AuthenticationOptions
{
};
})
.AddInMemoryClients(Clients.Get())
.AddInMemoryScopes(Scopes.Get())
.SetTemporarySigningCredential();
services.AddMvc();
services.AddTransient<ISignInService, SignInService>();
services.AddTransient<IUserRepository, UserRepository>();
services.AddTransient<IUserService, UserService>();
services.AddTransient<IResourceOwnerPasswordValidator, ResourceOwnerPasswordValidator>();
services.AddTransient<IProfileService, ProfileService>();
}
I know this method is imperfect as I am still testing some things, but when I run the application I get this error:
System.InvalidOperationException No storage mechanism for grants specified. Use the 'AddInMemoryStores' extension method to register a development version.
Obviously I don't want to use in memory stores for a production implementation, but I am not sure what I need to do to fix this.