Switch branches/tags
Nothing to show
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
bin Auth & Implicit Flow Examples Feb 21, 2018
public new and updated code samples Jul 19, 2018
routes Auth & Implicit Flow Examples Feb 21, 2018
views Auth & Implicit Flow Examples Feb 21, 2018
README.md new and updated code samples Jul 19, 2018
app.js Auth & Implicit Flow Examples Feb 21, 2018
package-lock.json Auth & Implicit Flow Examples Feb 21, 2018
package.json Auth & Implicit Flow Examples Feb 21, 2018

README.md

OneLogin OpenId Connect Implicit Flow Sample

This sample app demonstrates how to authenticate users in single page apps and does not require any server side code.

The sample makes use of a pure Javascript OpenId Connect Client. We have included a minified version of this client in public/javascripts/oidc-client.min.js or you can fetch the latest version here.

We have kept this sample to minimum functionality. However the UserManager in OIDC Client library has many useful features for authenticating via popups, logging out, and getting user info. Check out the wiki and samples in the Github repo.

Setup

In order to run this sample you need to setup an OpenId Connect app in your OneLogin Admin portal.

If you don't have a OneLogin developer account you can sign up here.

Clone this repo and then update /javascripts/main.js with the client_id you obtained from OneLogin and the subdomain of your OneLogin account.

Note that with the Implicit flow the client_secret is not required.

The sample will automatically set the redirect_uri to the host location that the sample is running on. You need to make sure that this matches what you specified as the Redirect Uri when you setup your OIDC app connector in the OneLogin portal.

Run

This sample uses node to serve up the single home page.

From the command line run

> npm install
> npm start

Local testing

By default these samples will run on http://localhost:3000.

You will need to add your callback url to the list of approved Redirect URIs for your OneLogin OIDC app via the Admin portal. e.g. http://localhost:3000/oauth/callback