You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Angular 5 with .Net Core Web API backend that is authenticated using Auth0. The code was based on samples and I created a working application to demonstrate OAuth using Auth0.
1
+
# Auth0 + Angular 5 + .Net Core Web API
2
+
A couple of weeks ago I was working on a project in an Angular 5 Single Page Application that communicates with several .NET Core Web API Microservices. One of the main challenges I ran into was to find a way to authenticate the user among the different services that the application communicates. After looking at different identity providers I decided to go with Auth0 as identity provider.
3
+
4
+
I created a concept application based on the official documentation provid
5
+
ed by Auth0.
6
+
7
+
### Authentication Workflow
8
+
9
+
Here is the authentication workflow that the Single Page Application will go through when accessing a protected Web API.
10
+
1. User logs into Single Page Application
11
+
2. The application redirects the user to the Auth0 login screen
12
+
3. User enters credentials or registers as a new user
13
+
4. Auth0 returns an access token that the Single Page Application saves in local storage
14
+
5. The Single Page Application requests data from the .NET Core Web Api sending the Access Token in the Authorization Header
15
+
6. The .NET Core Web Api validates the token and reads any claims sent in the access token
16
+
7. Information about the authenticated user is available within the .NET Web API
17
+
18
+
19
+
Single Page Applications authenticate using an Implicit Grant flow. The idea is that the application will never have a access to the username and password typed by the user. It is the responsibility of a third party identity provider to authenticate the user and return a token that will allow the client application to get information about the user and having access to backend APIs.
0 commit comments