Giter Site home page Giter Site logo

oidc_simple_client's Introduction

oidc_simple_client

This is a simple OpenID Connect/OAuth2 html/javascript client that you can use to test the following flows

  • Implicit Grant
  • Auth Code flow
  • Auth Code flow with PKCE
  • ROPC

It uses no library, like MSAL, and implements all interactions with the Identity Provider using javascript

A live version of this webapp exists here https://cljungoauthtest.azurewebsites.net/

Configuration

Edit the config.json file to include your IDP settings.

Items you must change are

  • client_id - App registraion GUID
  • metadataUrl - Endpoint where to find the IDP metadata

Items you may change are:

  • client_secret - if you are testing testing the Auth Code flow (without PKCE), you need the client_secret
  • endpoints - if you are able to retrieve the metadata, you can manually add the endpoints in the config file
{
	"client_id": "...guid...",
	"client_secret": "...secret key for webapp, blank for SPA/POKCE...",
	"scope": "openid offline_access {clienty_id}",
	"response_type": "code",
	"response_mode": "query",
	"PKCE": false,
	"ROPC": false,
	"redirectUrl": "http://localhost:3000/index.html",
	"authorization_endpoint": "",
	"token_endpoint": "", 
	"end_session_endpoint": "",
	"metadataUrl": "https://yourtenant.b2clogin.com/yourtenant.onmicrosoft.com/B2C_1A_signup_signin/v2.0/.well-known/openid-configuration"
}

Running it

You can start the webapp easily using Node or Python (see start-nodejs.ps1 and start-python.ps1 for details).

At the start page, edit the url to your config file and press the Load Config. Then, make any modifications you may need, like change client_id or endpoint urls, and then press Save Config. This will set the config in the browsers local storage. Then select the flow you like to test.

Start Page

The page per respective flow starts by showing the url that it is about to invoke to the IDP. You can click the link, copy the link to a separate tab or press the button.

Flow Page

After you go through the IDP authentication sequence, you will return to the same page with the id and access token displayed. There are hyperlinks to view the tokens in jwt.ms.

Result Page

oidc_simple_client's People

Contributors

cljung avatar

Stargazers

 avatar

Watchers

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