Skip to content

Commit 4f34fbf

Browse files
committed
Removed Docker and included more documentation
1 parent dc0dc7d commit 4f34fbf

File tree

5 files changed

+31
-37
lines changed

5 files changed

+31
-37
lines changed

Auth0AngularSpa/Properties/launchSettings.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"iisSettings": {
33
"windowsAuthentication": false,
44
"anonymousAuthentication": true,
@@ -11,17 +11,18 @@
1111
"IIS Express": {
1212
"commandName": "IISExpress",
1313
"launchBrowser": true,
14+
"launchUrl": "https://localhost:44366/",
1415
"environmentVariables": {
1516
"ASPNETCORE_ENVIRONMENT": "Development"
1617
}
1718
},
1819
"Auth0AngularSpa": {
1920
"commandName": "Project",
2021
"launchBrowser": true,
21-
"applicationUrl": "https://localhost:5001;http://localhost:5000",
2222
"environmentVariables": {
2323
"ASPNETCORE_ENVIRONMENT": "Development"
24-
}
24+
},
25+
"applicationUrl": "https://localhost:5001;http://localhost:5000"
2526
}
2627
}
2728
}

Auth0SpaWebAPICore.sln

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ VisualStudioVersion = 15.0.27703.2042
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Auth0WebApi", "Auth0WebApi\Auth0WebApi\Auth0WebApi.csproj", "{5F572260-4529-4661-BAB0-D67708F2AC70}"
77
EndProject
8-
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "Auth0WebApi\docker-compose.dcproj", "{072E38D9-3C81-4CED-8FE0-0548AEF8D3B1}"
9-
EndProject
108
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClientAngular", "Auth0AngularSpa\ClientAngular.csproj", "{FB482F78-C31E-4E66-B7E3-BF9F1357EC6A}"
119
EndProject
1210
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{3E11B75C-7D15-4316-AD87-F5FF83390918}"
@@ -28,10 +26,6 @@ Global
2826
{5F572260-4529-4661-BAB0-D67708F2AC70}.Debug|Any CPU.Build.0 = Debug|Any CPU
2927
{5F572260-4529-4661-BAB0-D67708F2AC70}.Release|Any CPU.ActiveCfg = Release|Any CPU
3028
{5F572260-4529-4661-BAB0-D67708F2AC70}.Release|Any CPU.Build.0 = Release|Any CPU
31-
{072E38D9-3C81-4CED-8FE0-0548AEF8D3B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32-
{072E38D9-3C81-4CED-8FE0-0548AEF8D3B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
33-
{072E38D9-3C81-4CED-8FE0-0548AEF8D3B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
34-
{072E38D9-3C81-4CED-8FE0-0548AEF8D3B1}.Release|Any CPU.Build.0 = Release|Any CPU
3529
{FB482F78-C31E-4E66-B7E3-BF9F1357EC6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3630
{FB482F78-C31E-4E66-B7E3-BF9F1357EC6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
3731
{FB482F78-C31E-4E66-B7E3-BF9F1357EC6A}.Release|Any CPU.ActiveCfg = Release|Any CPU

Auth0WebApi/Auth0WebApi/Dockerfile

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
{
2-
"$schema": "http://json.schemastore.org/launchsettings.json",
1+
{
32
"iisSettings": {
4-
"windowsAuthentication": false,
5-
"anonymousAuthentication": true,
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
65
"iisExpress": {
76
"applicationUrl": "http://localhost:55236",
87
"sslPort": 44394
98
}
109
},
10+
"$schema": "http://json.schemastore.org/launchsettings.json",
1111
"profiles": {
1212
"IIS Express": {
1313
"commandName": "IISExpress",
14+
"workingDirectory": "https://localhost:44394/",
1415
"launchBrowser": true,
1516
"launchUrl": "api/values",
1617
"environmentVariables": {
@@ -21,10 +22,10 @@
2122
"commandName": "Project",
2223
"launchBrowser": true,
2324
"launchUrl": "api/values",
24-
"applicationUrl": "https://localhost:5001;http://localhost:5000",
2525
"environmentVariables": {
2626
"ASPNETCORE_ENVIRONMENT": "Development"
27-
}
27+
},
28+
"applicationUrl": "https://localhost:5001;http://localhost:5000"
2829
}
2930
}
3031
}

README.MD

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1-
# Angular-5-Net-Core-Web-API-with-Auth0
2-
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.
20+
The code is available in my GitHub account.

0 commit comments

Comments
 (0)