Paul Plato
Paul Plato

Reputation: 1501

Customizing ASP.NET Identity 3

I am currently evaluating ASP.NET Identity 3 and I am looking to use a new data store for user member ship information, hence the need to customize the User, Role, UserRole, UserClaims Classes

In ASP.NET Identity 2.x, all that was required was for the User classes to implement IUser<Key> and Role classes implement IRole<key> and for the UserStore Classes implement a series of interfaces I chose to omit here for brevity sake, likewise for the role classes

However studying the source code of current implementation suggests that user classes must inherit from IdentityUser class, Role class must inherit from IdentityRole class and so on and so forth. It seems the IUser and the IRole interfaces no longer exist.

I did like a lot of control in the design of my model classes and currently it seems there is no light at the end of this tunnel. What do I do if I want to create usermanagement classes but don't want to inherit from them Identity*** classes?

Upvotes: 0

Views: 353

Answers (1)

DOMZE
DOMZE

Reputation: 1369

Identity 3.0 is now based on Interfaces. You can use your POCO object and customize your stores with the functionality you plan on using.

Here's Identity 3 source code: https://github.com/aspnet/Identity/tree/dev/src/Microsoft.AspNetCore.Identity

I've successfully implemented Identity using an Active Directory back store as well as a MSSQL database.

Upvotes: 0

Related Questions