SSO Integration Guide

From Veridu

SSO Integration Guide

Follow this guide to create an SSO integration in minutes.

Before you code:

  • Create a Veridu Dashboard account
  • Generate an API Key on the Dashboard (you can use dev keys for developing/testing)

In a nutshell

  1. // Add a postMessage event listener on your window object 
  2. window.addEventListener('message', function (evt) {
  3.     console.log(evt.data);
  4. });
  5.  
  6. // Open a dialog window
  7. window.open('https://widget.veridu.com/0.3/sso/login/PROVIDER/YOUR_API_KEY?language=en-us&mobile=true&session=&nonce=nonce&redirect=about:blank', 'sso', 'height=500,width=500');

Where:

  • PROVIDER: is one of the the providers listed here
  • YOUR_API_KEY: is the API Key generated/retrieved from the dashboard

Steps

  1. Add a postMessage event listener on your window object
    1. window.addEventListener('message', function(event){
    2.     if(event.origin === 'https://widget.veridu.com') {
    3.         console.log(event);
    4.    }
    5. });
  2. Open a dialog window
    1. window.open('https://widget.veridu.com/0.3/sso/login/PROVIDER/YOUR_API_KEY?language=en-us&mobile=true&session=&nonce=nonce&redirect=about:blank', 'sso', 'height=500,width=500');
    Where:
    • PROVIDER: is one of the the providers listed here (on lowercase)
    • YOUR_API_KEY: is the API Key generated/retrieved from the dashboard
  3. Callback set on #1 will be called with a populated Javascript Event
    1. {
    2. ...
    3.     data: {
    4.         "veridu_id": "Veridu_Username",
    5.         "veridu_provider": "provider" ,
    6.         "veridu_session": "Veridu_Session",
    7.         "veridu_nonce":"nonce",
    8.         "veridu_name":"John Doe",
    9.         "veridu_email":"[email protected]"
    10.     }
    11. ...
    12. }
  4. Start querying the endpoints (a worker will be gathering the authenticated user's information right after the login)
    Endpoints you can query include:
    For a full list of endpoints please see: Category:Endpoint
    Tip: You can use polling to the Profile or User Resource to have realtime updates