Giter VIP home page Giter VIP logo

openidconnectindepth's Introduction

OpenID Connect in Depth

OpenID Connect code sample (Angular 5, ASP.NET Core 3.0, IdentityServer4) containing SSOn/Out, reference tokens, custom grants and multi-tenancy.

Single Sign On / Out

Run Angular & MVC clients - signing in is only required once. When signing out of the IDP the other client is notified and signed out of.

Reference tokens

Sample.API expects a reference token and validates this with the IDP on each call (default caching applies).

Custom grant

When calling Sample.SecondAPI from Sample.API a new access token is requested (keepin the identity of the current user) with the required scope for the second API.

The custom grant is a token exchange grant. This allows the user's identity to flow through a set of APIs, avoids access tokens that are too permissive (audience too large) and allows checking user rights to a certain API (scope) when exchanging the token.

Multi-tenancy

Test by launching on the correct host. Tenant 1 = https://localhost:44318, Tenant 2 = https://localhost:44319

Implemented features are:

  • the tenant information can be used at client level to adjust the client accordingly (eg: to change colours)
  • the tenant id is passed through to the IDP. This allows separating out user stores depending on the tenant. In this case, localhost:44318 will allow local login (with test users), while localhost:44319 allows Google authentication.
    This approach keeps the client clean: client only needs to know about one IDP, and it's the IDP that's responsible for using the correct user store.
  • the tenant id is also added to the access token. This can be used to diversify between tenants at level of the API.

openidconnectindepth's People

Contributors

kevindockx avatar dietergoetelen avatar

Watchers

James Cloos 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.