Setting up Auth0 Single Sign-On

Auth0 is a third-party authentication service that enables users to be automatically logged in to GoodData seamlessly. When you implement Auth0 in your GoodData domain, users of your workspace can access GoodData without using GoodData-specific credentials.

For more information on Auth0, see https://auth0.com/. For more information on GoodData and SSO, see Single Sign-On Overview.

GoodData uses the SAML protocol for exchanging information with Auth0.

This article provides instructions for configuring Auth0 authentication for your GoodData domain.

Configure SSO

Steps:

  1. Log in to your Auth0 Dashboard, go to the Application section, and create a new application for GoodData. When prompted to select the application type, select Regular Web Applications.

  2. In the newly created application, go to the Settings tab. Copy the values in the Domain and Client ID fields, and save them for later use.

  3. Go to the Add-ons tab, and toggle SAML2 Web App. The popup dialog appears.

  4. In the Application Callback URL field, enter the callback URL:

    https://{your-subdomain-name}.on.gooddata.com/gdc/account/samllogin
    
  5. In the Settings section, update the SSO settings as follows:

    {
      "audience": "GoodData",
      "recipient": "https://{your-subdomain-name}.on.gooddata.com/gdc/account/samllogin",
      "mappings": {
        "email": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
      },
      "signatureAlgorithm": "rsa-sha256",
      "nameIdentifierFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
      "nameIdentifierProbes": [
        "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
      ],
      "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
    }
    
  6. Save the changes.

  7. Go to the Usage tab, and do the following:

    1. Copy the value in the Identity Provider Login URL field, and save it for later use.
    2. Download the IdP metadata file.
    3. (Optional) Download the Auth0 certificate.
  8. Close the popup dialog, and go back to the Settings tab of the GoodData application.

  9. In the Allowed Callback URLs field, enter the application callback URL (see Step 4) and the Identity Provider login URL (see Step 7a):

    https://{your-subdomain-name}.on.gooddata.com/gdc/account/samllogin, {idp_login_url}
    
  10. In the Allowed Web Origins field, enter the URL pointing to your application portal (optionally, include the port). For example:

    https://my.domain.com:8000
    
  11. Save the changes.

  12. Determine which SSO scenario you are configuring and follow the relevant instructions:

  13. If you chose to use the Identity Provider-initiated SSO scenario, test the configured SSO to make sure you can log in to the GoodData workspace using your Auth0 credentials. Otherwise, the configuration process is completed.

Test the SSO Configuration

Testing the SSO configuration is relevant only if you chose to use the Identity Provider-initiated SSO scenario.

Steps:

  1. Create an HTML page using the following code (replace the CLIENT_ID, DOMAIN, and IDENTITY_PROVIDER_LOGIN_URL placeholders with your values, see Steps 2 and 7a in the previous procedure):

    <!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <HTML>
    <BODY>
    <p> Click on the button to log in </p>
    <script src="https://cdn.auth0.com/js/lock/11.14/lock.min.js"></script>
    <script type="text/javascript">
      var lock = new Auth0Lock('CLIENT_ID', 'DOMAIN',{
            auth: {
              redirectUrl: 'IDENTITY_PROVIDER_LOGIN_URL',
              responseType: 'token',
              params: {scope: 'openid'}
            }
        });
      function signin() {
        lock.show();
      }
    </script>
    <button onclick="signin()">Login</button>
    </BODY>
    </HTML>
    
  2. Log in to your Auth0 Dashboard, go to the Application section, and open the GoodData application.

  3. Go to the Settings tab.

  4. In the Allowed Web Origins field, enter the localhost URL with the port that you are going to use for testing purposes, for example:

    https://127.0.0.1:8000
    
  5. Save the changes.

  6. Open the HTML page in a web browser using the localhost URL:

    https://127.0.0.1:8000/{page}.html
    

    The page with the Login button opens.

  7. Click Login. The Auth0 login page opens.

  8. Log in to Auth0 as usual. Auth0 authenticates you, and you are redirected to your GoodData workspace. The SSO configuration works as expected. You and your users can now access the GoodData workspace using Auth0 SSO.

  9. Go back to the GoodData application in your Auth0 dashboard.

  10. On the Settings tab, remove the localhost URL from the Allowed Web Origins field, and save the changes.