Example of custom membership system using ASP.NET Identity 2, ASP.NET Web API 2 and OWIN Bearer token authentication
The AspNetIdentity.WebApi is an HTTP ASP.NET WebApi 2 service which acts as back-end for SPA frontend AspNetIdentity.Angular built using Angular 5.
Default users with passwords (e.g SuperPowerUser) are created in AspNetIdentity.WebApi.Migrations.Configuration.CreateUsers
Implementation for the custom Microsoft.AspNet.Identity.UserManager with own custom database entities:
XUserwith custom columnsXRoleXUserRoleXLoginXClaim- managers:
XUserManagerandXRoleManager
EntityFramework entities are mapped to custom database tables.
OAuth 2.0 Bearer Access Token generation and consumption is implemented in Startup.Auth.cs mainly by
Identity\Providers\CustomOAuthProvider.csIdentity\Providers\JwtTokenFormat.csIdentity\Providers\RefreshTokenProvider.cs
The app was generated with angular-cli and can be run by npm install and then npm start and is hosted on http://localhost:4200/