asp.net 5, indentity 3 and modular projects

168 views Asked by At

I'm trying to create the modular project on the asp.net 5 (vnext) on dnxcore50. I have the problems with the new Identity 3 (or either with replacing it with the custom security classes).

My project contains Models subproject, DataAccess subproject and DataAccess.EntityFramework subproject. DataAccess contains only interfaces (for example, repositories to work with entities). DataAccess.EntityFramework contains Entity Framework implementation of DataAccess. (I don't want to have close ties with the EF, only via interfaces.) Everything is good, it works.

But now I need to add User entity. If I want to use Identity, I need to make User class derived from IdentityUser[int]. But IdentityUser class is located in Microsoft.AspNet.Identity.EntityFramework! How the model class can be located in the ORM-specific namespace?

So because of this I want to replace the Identity with my custom security solution, but now User property of the controller is ClaimsPrincipal and it looks more complicated to replace it than it was with IPrincipal.

The only way I can see now is to create another one property User in the base controller and write everything by hands, but it is not what I want to do.

So I need some advise how can I solve all of this.

Thanks!

1

There are 1 answers

0
Dmitry Sikorsky On BEST ANSWER

So, I've got an answer from MS: https://github.com/aspnet/Identity/issues/489

It's strange for me, but it looks that Identity is just for EF. Ok.

I've found the way how to integrate my own users manager into the asp.net 5's app, so problem is solved:

Asp.net vNext Cookie Authentication