Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 and .NET Web API Authentication

What is the best way to have a username and password authentication system that works between Angular 2 and .NET Web API?

like image 786
Adrian Brand Avatar asked Mar 07 '17 06:03

Adrian Brand


1 Answers

First of all try to avoid using self implemented methods. Most commonly used approach is to use Json web token. https://jwt.io/ There for when you log in, return Token to angular2 and then pass it on every request. There are many examples of implementation and libraries to be used. https://github.com/auth0/angular2-jwt

How to use JWT in MVC application for authentication and authorization?

like image 87
Brivvirs Avatar answered Sep 19 '22 02:09

Brivvirs