Giter Club home page Giter Club logo

defra.identity-demo's Introduction

Identity demo


Example using auth0 and hapi to demonstrate:

  • Securing two separate web applications with SSO
  • Providing access_token and id_token to the application
  • How using the audience we can use these tokens to securely call an API
  • How to embelish a JWT in an OpenID connect conformant way using namespaces for roles & permissions

logo Identity demo

Running the application

First obtain the 4 .env files.

There are two example web servers (Elm Web and Grants Web) and two api servers (Elm API and Grants API).

$ cd web $ npm run start:elm $ npm run start:grants

$ cd api $ npm run start:api $ npm run start:grants

Links

https://auth0.com/docs/architecture-scenarios/web-app-sso/part-1#authentication-flow

Call API Using the Authorization Code Flow https://auth0.com/docs/flows/concepts/auth-code

Call Your API from a Regular Web App If your application executes on a server and you want to configure it to use OAuth 2.0 to access an API, read these docs.

  • Overview of the flow
  • Executing the flow

https://auth0.com/docs/flows/guides/auth-code/call-api-auth-code#request-tokens

  1. Authorize the user: Request the user's authorization and redirect back to your app with an authorization code.
  2. Request Tokens: Exchange your authorization code for tokens.
  3. Call your API: Use the retrieved Access Token to call your API.
  4. Refresh Tokens: Use a Refresh Token to request new tokens when the existing ones expire.

https://auth0.com/docs/api-auth/tutorials/adoption/refresh-tokens

https://auth0.com/docs/extensions/authorization-extension/v2

https://auth0.com/docs/extensions/authorization-extension/v2/rules

https://auth0.com/docs/extensions/authorization-extension/v2/implementation/configuration

https://auth0.com/docs/extensions/authorization-extension/v2#token-contents

defra.identity-demo's People

Contributors

davidjamesstone 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.