All Projects → alanmacgowan → IdentityServerSample

alanmacgowan / IdentityServerSample

Licence: MIT license
Sample ASP.NET Core MVC and Angular apps and API using Identity Server 4

Programming Languages

C#
18002 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
typescript
32286 projects
HTML
75241 projects

Projects that are alternatives of or similar to IdentityServerSample

Identityserver4
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
Stars: ✭ 8,428 (+33612%)
Mutual labels:  oauth2, openid-connect, identityserver4
Identityserver4 Example
Example IdentityServer 4 Implementation
Stars: ✭ 136 (+444%)
Mutual labels:  oauth2, openid-connect, identityserver4
Oidc.example
OIDC (OpenID Connect) Example for http://openid.net/connect/
Stars: ✭ 190 (+660%)
Mutual labels:  oauth2, openid-connect, identityserver4
Jpproject.identityserver4.sso
🔒 ASP.NET Core 3.1 Open Source SSO. Built within IdentityServer4 🔑
Stars: ✭ 298 (+1092%)
Mutual labels:  oauth2, openid-connect, identityserver4
Jpproject.identityserver4.adminui
🔧 ASP.NET Core 3 & Angular 8 Administration Panel for 💞IdentityServer4 and ASP.NET Core Identity
Stars: ✭ 717 (+2768%)
Mutual labels:  oauth2, openid-connect, identityserver4
Identityserver4.samples
Samples for IdentityServer4,use .net core 2.0
Stars: ✭ 561 (+2144%)
Mutual labels:  oauth2, openid-connect, identityserver4
Angularaspnetcoreoauth
Sample project demonstrating user authentication and identity with Angular, Asp.Net Core and IdentityServer4
Stars: ✭ 268 (+972%)
Mutual labels:  oauth2, openid-connect, identityserver4
Identityserver4.samples
Samples for IdentityServer4
Stars: ✭ 1,002 (+3908%)
Mutual labels:  oauth2, openid-connect, identityserver4
Identitybase
IdentityBase is a Universal Identity Platform for web, mobile and IoT built on top of IdentityServer.
Stars: ✭ 112 (+348%)
Mutual labels:  oauth2, openid-connect, identityserver4
External Auth Server
easy auth for reverse proxies
Stars: ✭ 189 (+656%)
Mutual labels:  oauth2, openid-connect
Oauthlib
A generic, spec-compliant, thorough implementation of the OAuth request-signing logic
Stars: ✭ 2,323 (+9192%)
Mutual labels:  oauth2, openid-connect
Nginx Sso
SSO authentication provider for the auth_request nginx module
Stars: ✭ 195 (+680%)
Mutual labels:  oauth2, openid-connect
Aspnetcoreangularsignalrsecurity
Security with ASP.NET Core, SignalR and Angular
Stars: ✭ 171 (+584%)
Mutual labels:  oauth2, identityserver4
Identitymodel.oidcclient.samples
Stars: ✭ 159 (+536%)
Mutual labels:  oauth2, openid-connect
Authing
🔥Authing - IDaaS/IAM solution that can Auth to web and mobile applications.
Stars: ✭ 247 (+888%)
Mutual labels:  oauth2, openid-connect
Authlib
The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
Stars: ✭ 2,854 (+11316%)
Mutual labels:  oauth2, openid-connect
Appauth Android
Android client SDK for communicating with OAuth 2.0 and OpenID Connect providers.
Stars: ✭ 1,922 (+7588%)
Mutual labels:  oauth2, openid-connect
Auth0.net
.NET client for the Auth0 Authentication & Management APIs.
Stars: ✭ 200 (+700%)
Mutual labels:  oauth2, openid-connect
example-oidc
OIDC (OpenID Connect) Example for http://openid.net/connect/
Stars: ✭ 221 (+784%)
Mutual labels:  openid-connect, identityserver4
GoogleSignIn-iOS
Enables iOS and macOS apps to sign in with Google.
Stars: ✭ 198 (+692%)
Mutual labels:  oauth2, openid-connect

IdentityServerSample

Sample ASP.NET Core MVC app, Angular and API using Identity Server 4 and Entity Framework to store Identity tables (Users, Roles, UserRoles, UserClaims, UserLogins, etc) and Identity Server tables (Clients, ClientSecrets, PersistedGrants, IdentityResources, ApiResources, etc)

Quick start

Edit soution properties to set multiple startup projects (select API, WebApp, AngularApp and IdentityServer as start projects).
Then just run F5, this will start the Identity Server on https://localhost:44367/, API on https://localhost:44374/, Angular App on https://localhost:44398/ and Web App on https://localhost:44340/.
First run will initialize the database IdentityServerSample with all the tables and some sample data and Identity Server configuration data.
Go to Web App -> SignIn, this will redirect to Identity Server. Register if it's first time, accept consent and once logged in can access API resources.

Diagram

Scenarios Covered

  • User Authentication (WebApp)
  • User Authentication (AngularApp)
  • User Authentication from javascript (oidc-client.js)
  • User Authentication with 3rd party provider (Google)
  • Call API from C# (WebApp)
  • Call API from javascript (WebApp)
  • Call API from Angular (AngularApp)
  • Long lived API access using refresh tokens (allow requesting new access tokens without user interaction)

Steps

1 - IdentityServer config:

(Config.cs)
    a. Clients:
        i.  MVC application (HybridClientCredentials) ["mvc"]
        ii. SPA application (Implicit) ["Spa"]
    b. Resources:
        i.  Identity (OpenId, Profile)
        ii. Api ["api1"]

(Startup.cs)
    a. AddIdentity
    b. AddIdentityServer
          AddDeveloperSigningCredential
          AddAspNetIdentity
          AddConfigurationStore
          AddOperationalStore
    c. AddAuthentication
          AddGoogle
    
2 - MVC application config:

(Startup.cs)
    a. AddAuthentication
          AddCookie
          AddOpenIdConnect
                          
3 - API config:

(Startup.cs)
    a. AddAuthentication
          AddJwtBearer
    b. AddAuthorization
    c. AddCors     
          

Useful Resources

Identity Server

JWT

Pluralsight Courses

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].