Search code examples
asp.net-mvcasp.net-web-apiasp.net-web-api2asp.net-identity-2

ASP.NET Identity Login query customization


Can I customize the query for Login while using asp.net identity for web api? Basically, I want to write my own query to authenticate and generate token.

Thanks


Solution

  • You can write your own UserStore by implementing IUserStore (and whatever other interfaces you want your store to provide: IUserPasswordStore, IUserRoleStore, IUserEmailStore, IUSerLockoutStore etc), and write your own TokenProvider by implementing IUserTokenProvider.