How to customize authentication to my own set of tables in asp.net web api 2?

Viewed 28595

In the default AccountController created I see

    public AccountController()
        : this(Startup.UserManagerFactory(), Startup.OAuthOptions.AccessTokenFormat)
    {
    }

In Startup.Auth.cs I see

    UserManagerFactory = () => 
                new UserManager<IdentityUser>(new UserStore<IdentityUser>());   

Seems like the implementation of UserStore comes from Microsoft.AspNet.Identity.EntityFramework.

So, to customize the authentication do I have to implement my own version of UserStore like

 class MYSTUFFUserStore<IdentityUser> : UserStore<IdentityUser>
 {
 } 

and override the methods and then do this in Startup.Auth.cs

UserManagerFactory = () => 
               new UserManager<IdentityUser>(new MYSTUFFUserStore<IdentityUser>());   

I am looking for a correct way to customize the authentication.

1 Answers
Related