Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1.32 KB

File metadata and controls

37 lines (28 loc) · 1.32 KB

Jwt Authentication without ASP.NET Core Identity 2.0

jwtauth

A Jwt based authentication sample for ASP.NET Core 2.0 without using the Identity system. It includes:

  • Users and Roles tables with a many-to-may relationship.
  • A separated EF Core data layer with enabled migrations.
  • An EF Core 2.0 based service layer.
  • A Db initializer to seed the default database values.
  • An account controller with Jwt and DB based login, custom logout and refresh tokens capabilities.
  • 2 sample API controllers to show how user-roles can be applied and used.
  • A Jwt validator service to show how to react to the server side changes to a user's info immediately.
  • An Angular 4.3+ Client.

How to run the Angular 4.3+ Client

  • Install the Angular-CLI.
  • Open a command prompt console and then navigate to src/ASPNETCore2JwtAuthentication.AngularClient/ folder.
  • Now run the following commands:
npm install
ng serve -o
  • Then open another command prompt console and navigate to src/ASPNETCore2JwtAuthentication.WebApp/ folder.
  • Now run the following commands:
dotnet restore
dotnet watch run