Coder Social home page Coder Social logo

shauryadhadwal / oauth2-oidc-client-integrations Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 1.0 1.04 MB

Client Integrations with OAuth2.0 & OIDC Identity providers using different Grant Flows.

JavaScript 44.25% HTML 20.44% CSS 1.91% Dockerfile 0.46% TypeScript 28.34% Pug 4.61%
ory-hydra ory oauth2 oidc expressjs reactjs javascript identity

oauth2-oidc-client-integrations's Introduction

OAuth2.0 & OIDC integrations with clients using different grant flows

Will be using Ory Hydra as an Identity and Authorization server to mimic IdP service. You can feel free to use okta or AuthO etc. as well.

These are just sample applications to help you get started with OAuth2.0 and OIDC quickly. Not following any best practices or coding guidelines.

These samples can be used in different contexts:

  1. You are building an Identity Provider for you organization(THE COMPANY) using ory hydra (could be others like okta etc.). Think of trusted-apps as your own applications/apis (like Google Services) and external-apps as 3rd party clients who want to access your apis.
  2. Your organization (THE COMPANY) is using the services of an external-app (SAAS, PAAS) and have integrated it into your trusted-app, a user can go to the external-app from your trusted-app without filling his/her credentials again on external-app and start using it straight away thanks to Single Sign On.

Setting up Ory Hydra quickly

You can follow the steps laid out here on the Ory Hydra Documentation

Authorization Grant Flows

If you are new to this, then you can read about it here

Authorization Code Grant Flow

external-app-one A server side node express application demonstrating Auth code flow grant

  • Confidential

Implicit Grant Flow

external-app-two A React.js App demonstrating Implicit flow grant

  • Public Client

Authorization Code Grant Flow with PKCE

external-app-three A React.js App demonstrating Auth Code with PKCE

  • Public Client

Auto-refresh tokens on receiving 401 HTTP status

external-app-four A React.js App demonstrating Auth Code with PKCE. Using axios library to catch 401 response code in interceptors and initiating a refresh token request.

  • Public Client
  • Same as external-app-three

Other Projects

trusted-app-one An API server to emulate a Resource Server. Accepts access_tokens and validates them at /introspect endpoint of Authorization Server

How to get started?

  1. You need docker and docker-compose
  2. Run docker-compose up in ory-hydra folder
  3. Run npm run build && npm start in ory-hydra-login-consent-node
  4. Run npm run start in trusted-app-one folder
  5. Check the npm scripts in any of the external-app folders you want to test
  6. For client registration with ory-hydra, register-client.json has been provided in the folders.

TODOs

  1. Front-channel Logout
  2. Back-channel Logout

Resources

Which Auth Grant Flow to use? /token endpoint

oauth2-oidc-client-integrations's People

Contributors

shauryadhadwal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

imrushi

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.