Reputation: 117
I am using IdentityServer4 with Asp.Net Identity. I need to implement a custom identity store which sounds easy enough, but all of the examples I see use EntityFramework core which I am not using.
Perhaps there is another way to use a custom user store. Can anyone point me to an example of using a custom credential store using IdentityServer4.
Upvotes: 2
Views: 6558
Reputation: 101
Basically it boils down to Implementing an IProfileService and an IResourceOwnerPasswordValidator and registering the implementations with the config builder.
This blog post shows a succinct implementation of this
This extension class is where it all happens
public static class CustomIdentityServerBuilderExtensions
{
public static IIdentityServerBuilder AddCustomUserStore(this IIdentityServerBuilder builder)
{
builder.Services.AddSingleton<IUserRepository, UserRepository>();
builder.AddProfileService<CustomProfileService>();
builder.AddResourceOwnerValidator<CustomResourceOwnerPasswordValidator>();
return builder;
}
}
Upvotes: 5