Auth0 SAML integration guide

This integration guide shows how to configure Auth0 as a SAML single sign on provider for your Redis Cloud account.

Redis Cloud

This guide shows how to configure Auth0 as a SAML single sign-on identity provider (IdP) for your Redis Cloud account.

To learn more about Redis Cloud support for SAML, see SAML single sign-on.

Before completing this guide, you must verify ownership of any domains you want to associate with your SAML setup.

Step 1: Set up your identity provider (IdP)

Specify the SAML owner

  1. Sign in to your Auth0 account and navigate to User Management > Users.

    • Select the SAML owner.
    • Verify the details.

    SAML assertion requires first and last name, which are not available in the default user profile.

    Note:

    Depending how they are created, users can have different profiles.

    Auth0 user profile page with the user_metadata section used to hold the Redis account mapping
  2. Add user_metadata to fulfill the SAML assertion, then select Save.

    Auth0 action code that adds user_metadata to the SAML assertion, with the Save button

    The key-value pair of redisAccountMapping consists of a lowercase role name (owner, member, manager, billing_admin, or viewer) and your Redis Cloud Account ID found in the account settings.

    {
       "FirstName": "Test",
       "LastName": "User",
       "redisAccountMapping": "YOUR_REDIS_CLOUD_ID=owner"
    }
    
  3. Open Actions > Triggers and select post-login.

    Auth0 Actions menu with Triggers and the post-login trigger
  4. Select Create Action to create a new custom action.

    Auth0 post-login trigger page with the Create Action option
  5. Provide a name for the action and select Create.

    Auth0 Create Action dialog with a name field and the Create button
  6. Add the following code to the action:

    exports.onExecutePostLogin = async (event, api) => {
        const um = event.user.user_metadata || {};
        const am = event.user.app_metadata || {};
        api.samlResponse.setAttribute('email', event.user.email);
        api.samlResponse.setAttribute(
            'firstName',
            um.FirstName || ''
        );
        api.samlResponse.setAttribute(
            'lastName',
            um.LastName || ''
        );
        const mapping = am.redisAccountMapping || um.redisAccountMapping;
        if (mapping) {
            api.samlResponse.setAttribute('redisAccountMapping', mapping);
        } else {
            api.access.deny('missing_redis_account_mapping', 'redisAccountMapping not set for user');
        }
    };
    
  7. Select Deploy to save and deploy the action.

    Auth0 action editor with the Deploy button for saving and deploying the action
  8. Return to the post-login trigger and drag the action you just created to the trigger.

    Auth0 post-login flow with the custom action added to the trigger

    Select Apply to save your changes.

Create and configure the SAML application

  1. Open Applications > Applications and select Create Application.

    Auth0 Applications page with the Create Application button
  2. Provide a name for the Application and select Single Page Web Applications. Select Create.

    Auth0 Create application dialog with a name and Single Page Web Applications selected
  3. From the newly created application, go to Settings > Advanced Settings > Certificates.

    • Copy and save the Signing Certificate. You will need this information to configure SAML in admin console.
    Auth0 application Advanced Settings Certificates tab with the Signing Certificate
    • We suggest that you update the default logo of the application to the Redis icon for better visibility.
  4. From the newly created application, go to Addons and enable SAML 2 WEB APP.

    Auth0 application Addons tab with SAML 2 WEB APP enabled
  5. From the Usage tab:

    • Copy and save the Issuer value.
    • Copy and save the Identity Provider Login URL.

    You will need both of these values, along with the certificate value you copied in the previous step, to configure SAML in the Redis Cloud console.

    Auth0 SAML2 Web App Usage tab listing the SAML Login URL and Issuer values

Step 2: Configure SAML support in Redis Cloud

Now that you have you Auth0 IdP server ready, configure support for SAML in Redis Cloud.

Sign in to Redis Cloud

Sign in to your account on the Redis Cloud console.

Activate SAML in Access Management

To activate SAML, you need to have a local user (or social sign-on user) with the owner role. If you have the correct permissions, you will see the Single Sign-On tab.

  1. Fill in the information you saved previously in the setup form. This includes:

    • Issuer (IdP Entity ID): Issuer value from Auth0
    • IdP server URL: Identity Provider Login URL from Auth0
    • Assertion signing certificate: Certificate value from Auth0
    Redis Cloud Access Management Single Sign-On tab with the SAML setup form and Enable button

    Once you click Enable, wait a few seconds for the status to change.

  2. Download the service provider (SP) metadata. Save the file to your local hard disk.

    Redis Cloud panel for downloading the service provider (SP) metadata file
  3. Open the file in any text editor. Save the following text from the metadata:

    • EntityID: The unique name of the service provider (SP)
    Service provider metadata XML with the entityID value circled
    • Location : The location of the assertion consumer service
    Service provider metadata XML with the Assertion Consumer Service Location value circled

Step 3: Finish SAML configuration in Auth0

  1. Return to the Auth0 SAML application and select Addons > SAML 2 Web App > Settings:

    Auth0 SAML2 Web App Settings tab with the Application Callback URL field
    • Paste the Location link in Application Callback URL field.

    • Enter the following code in the Settings code area. Modify the audience variable with the EntityID value, and the recipient variable with the Location value from the metadata file you downloaded.

    {
      "audience": "<EntityID>",
      "recipient": "<Location>",
      "passthroughClaimsWithNoMapping": false,
      "nameIdentifierProbes": [
        "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
      ]
    }
    

    Scroll down and select Enable to apply the configuration.

IdP initiated SSO

To use IdP-initiated SSO with certain identity providers, you also need to set the RelayState parameter to this URL:

https://cloud.redis.io/#/login/?idpId=<ID>

Note:

Replace ID so it matches the AssertionConsumerService Location URL ID (the content after the last forward slash "/"). To learn more about how to configure service provider apps, see your identity provider’s documentation.

Step 4: Return to the Redis Cloud console

  1. Return to the Redis Cloud console and select Activate.

    Redis Cloud Activate SAML integration panel with the Activate button

    A popup appears, explaining that, in order to test the SAML connection, we need to login with credentials of a user defined in Auth0. Select Continue to go to the Auth0 login screen.

  2. The Auth0 login screen appears. Enter the credentials and select Sign In.

    Auth0 login screen shown when signing in to Redis Cloud with SAML

If everything is configured correctly, you will see the the Redis Cloud console screen. Your local account is now considered a SAML account.

To log in to the Redis Cloud console from now on, click on Sign in with SSO.

Sign in with SSO button
RATE THIS PAGE
Back to top ↑