Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mmacneil/angularaspnetcoreoauth
Sample project demonstrating user authentication and identity with Angular, Asp.Net Core and IdentityServer4
https://github.com/mmacneil/angularaspnetcoreoauth
angular aspnetcore identityserver4 oauth2 openid-connect
Last synced: about 3 hours ago
JSON representation
Sample project demonstrating user authentication and identity with Angular, Asp.Net Core and IdentityServer4
- Host: GitHub
- URL: https://github.com/mmacneil/angularaspnetcoreoauth
- Owner: mmacneil
- License: mit
- Created: 2019-03-12T00:22:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T03:47:21.000Z (almost 2 years ago)
- Last Synced: 2024-11-06T17:47:00.214Z (1 day ago)
- Topics: angular, aspnetcore, identityserver4, oauth2, openid-connect
- Language: C#
- Homepage: https://fullstackmark.com/post/21/user-authentication-and-identity-with-angular-aspnet-core-and-identityserver
- Size: 3.52 MB
- Stars: 353
- Watchers: 26
- Forks: 232
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AngularASPNETCoreOAuth
Sample project based on the blog post demonstrating how to build out an Implicit Grant OAuth flow utilizing OAuth2/OpenID Connect protocols implementing IdentityServer4 as our OpenID Connect Provider and then using it to authenticate an Angular SPA client to authorize access to an independent ASP.NET Core Web API.
## Development Environment
- Visual Studio 2019 Community
- Visual Studio Code 1.32.3
- .NET Core SDK 3.1
- Angular 8
- IdentityServer4 3.0.1
- SQL Server Express 2016 LocalDB## Setup
#### To run the demo:
**1.** Clone/Fork/Download this repository.
**2.** Create the database on your SQL Server Express LocalDB by using the dotnet cli to run the migrations from within the AuthServer.Infrastrucuture project folder.
AuthServer.Infrastructure> dotnet ef database update --context AppIdentityDbContext
AuthServer.Infrastructure> dotnet ef database update --context PersistedGrantDbContext
**3.** Install Angular CLI if necessary. `npm install -g @angular/cli`
**4.** Install Angular SPA dependencies.
Spa\oauth-client> npm install
**5.** Run the Angular CLI dev server to build and run the Angular app.
Spa\oauth-client> ng serve
- **Important:** This must be running on the default http://localhost:4200**6.** Build/Run the `AuthServer.sln` solution using your preferred method: Visual Studio, VSCode, dotnet CLI.
- **Important:** This must be running on http://localhost:5000**7.** Build/Run the `Resource.Api.sln` solution using your preferred method: Visual Studio, VSCode, dotnet CLI.
- **Important:** This must be running on http://localhost:5050**8.** Point a browser to `http://localhost:4200` to access the Angular client.
**9.** Use the *Signup* and *Login* functions to perform the authentication flow, then try and access the *Top Secret Area* to hit the protected ASP.NET Core Web API.
## Contact
[email protected]