Antonio
Antonio

Reputation: 19

Microsoft.AspNetCore.Identity without EF

I've followed the IdentityServer4 guide (at https://identityserver4.readthedocs.io/en/release) and everything was fine with the QuickStarts until I tried the 6th sample (AspNetIdentity).

This sample uses IdentityServer4.AspNetIdentity assembly. The standard implementation uses EF. The problem is that I need to use a different storage not based on DB.

I've been successful removing EF from a Identity AspNet application but not in AspNetCore.

The underlying models have changed a lot from AspNet to AspNetCore so how do I remove EF from an AspNetCore implementation?

Upvotes: 1

Views: 228

Answers (1)

Lutando
Lutando

Reputation: 5010

I think you're giving yourself more work than is required. IdentityServer4.AspNetIdentity basically in a nutshell, gives you some good plumbing to bridge the gap between you application's AspNetCore.Identity User DbContext, AspNetCore.Identity, and the IdentityServer4 user dependencies (IProfileService and IResourceOwnerValidator).

If I was in your situation I would rather implement my own IResourceOwnerValidator and IProfileService and then add them to the AspNetCore DI/Services container during your startup configuration.

The IProfileService is there to construct user claims from whatever user store you are using and the IResourceOwnerValidator is there to validate resource owner credentials during the resource owner/password flow.

Upvotes: 1

Related Questions