Giter Club home page Giter Club logo

quanliang2000 / angularaspnetcoreoauth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mmacneil/angularaspnetcoreoauth

0.0 1.0 0.0 1.99 MB

Sample project demonstrating user authentication and identity with Angular, Asp.Net Core and IdentityServer4

Home Page: https://fullstackmark.com/post/21/user-authentication-and-identity-with-angular-aspnet-core-and-identityserver

License: MIT License

C# 54.43% HTML 12.76% CSS 1.11% JavaScript 1.48% TypeScript 30.23%

angularaspnetcoreoauth's Introduction

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

6. Build/Run the AuthServer.sln solution using your preferred method: Visual Studio, VSCode, dotnet CLI.

7. Build/Run the Resource.Api.sln solution using your preferred method: Visual Studio, VSCode, dotnet CLI.

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]

angularaspnetcoreoauth's People

Contributors

mmacneil avatar respeto avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.