IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

ASP.NET Identity 3 Support

Open ry8806 opened this issue 10 years ago • 19 comments

I was wondering if there are any plans to implement AspNetIdentity for IdentityServer4?? For ASP.Net core 1.0?

ry8806 avatar Jan 23 '16 22:01 ry8806

We will see. We're not yet sure what the IUserService will look like in IdSvr4.

In essence, though, there it won't be hard for you to do this yourself in IdSvr4 (and it wasn't all that hard in IdSvr3).

brockallen avatar Jan 23 '16 23:01 brockallen

yeh, that's cool

Once you do know how the interface might look, then I wouldn't mind getting involved and writing the AspNetIdentity "bridge"

ry8806 avatar Jan 24 '16 11:01 ry8806

Cool. Thanks! I will leave this open then

leastprivilege avatar Jan 25 '16 07:01 leastprivilege

Once you think you've finalised the IUserService interface (I understand you've got lots of other things to do) - could you let me know and I will start having a look at it :)

ry8806 avatar Feb 01 '16 19:02 ry8806

Is there a way to work around the limitation of just using InMemoryUser? It's possible to read all the users from a DB into memory. The only problem with that solution is how to handle when user information changes in the DB.

Everywhere it's used it's injected as a List<InMemoryUser>, if it instead was injected as IList<InMemoryUser> then it would've been possible to create an implementation that read from an external source/DB.

Cybrosys avatar Mar 06 '16 21:03 Cybrosys

@Cybrosys please see #5 and the stackoverflow example to implement IUserService. Please note that IUserService will be replaced with something similar in the next release of Identity Server 4.

nikoszs avatar Mar 06 '16 23:03 nikoszs

Thank you @alzdrak !

Cybrosys avatar Mar 07 '16 07:03 Cybrosys

@ry8806 Update1 has been released. The two interfaces you're interrested in are IProfileService and IResourceOwnerPasswordValidator.

Cybrosys avatar Mar 08 '16 21:03 Cybrosys

Thanks - do we have a separate Repo for this, like we do in IdentitfyServer3 ??

ry8806 avatar Mar 14 '16 11:03 ry8806

not before RC2

leastprivilege avatar Mar 14 '16 11:03 leastprivilege

I've written simple implementations of both, but they're tied to *.Identity.EntityFramework, in case someone's interested (the tie-in is because of my usage of the IdentityUser class).

AspNetIdentity ProfileService and ResourceOwnerPasswordValidator.zip

Cybrosys avatar Mar 14 '16 19:03 Cybrosys

@Cybrosys FWIW, it is relatively simple to remove the dependency on Identity.EntityFramework by using UserManager instead of the model class directly to get its properties. This would mean e.g. replacing user.Id with await _userManager.GetUserIdAsync(user)

SimonTouchtech avatar Mar 21 '16 13:03 SimonTouchtech

I think you need to prioritize this issue, because Identity Server is unuseable for many people without ASP.NET Identity support and samples.

tibitoth avatar May 22 '16 09:05 tibitoth

I looked into integration IdentityServer4 with Asp.Net Core Identity. Here is my idea: https://github.com/tibold/IdentityServer4.Contrib.AspNetIdentity

I have copied some tests from the core project and made them work with AspNet Identity. Also created a sample project showing how the code is used. It is based on the default Asp.Net Core Web application template in Visual Studio. I tried to implement it with the least amount of changes.

What do you think?

tibold avatar May 27 '16 23:05 tibold

Next week I will investigate on your solution.

tibitoth avatar May 28 '16 09:05 tibitoth

I'll also take a look. Thx.

brockallen avatar May 28 '16 13:05 brockallen

I have made some progress on this. It is not as abstract as IS3 IdentityManager. For instance, Reflection is more limited in .NET Core. I created my solution however so that you can switch between the default InMemoryUser implementation and EF easily. SEE: https://github.com/PivotalAnimal/BlueConcord.IdentityServer.EntityFrameworkCore

klanglie avatar Jun 26 '16 17:06 klanglie

The SPA sample in the sample repo has asp.net id3 support.

leastprivilege avatar Jun 28 '16 06:06 leastprivilege

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 15 '20 18:01 lock[bot]