Skip to main content

Set Up Torq SSO: Auth0 with Entra ID

Follow this guide to set up SSO with Auth0, using Entra ID for secure and streamlined access control.

Updated this week

This guide walks you through configuring an Azure integration with Auth0, setting up an application within Auth0 for Torq, and completing the SSO setup in Torq. Additionally, it covers creating a custom rule in Auth0 to enrich ID tokens with group claims from Entra ID, which is crucial for role-based access control within Torq.

Important!
Before getting started, make sure you understand how to prevent user lockouts by reviewing this KB article.

Prerequisites

Ensure you have an Azure Connection configured in Auth0. If not, first set up an Azure integration with Auth0. After configuring, activate Extended Attributes under General settings, particularly the Get user groups option, to fetch group memberships from Entra ID.

Create a New Application in Auth0

  1. In Auth0, navigate to Applications and Create Application.

  2. Name it (e.g. Auth0 Torq), select Regular Web Applications, and Create.

    Screenshot of creating an Azure app.
  3. Under Connections, choose the Azure connection (e.g. LeonidAzure).

    Screenshot of configuring connection in the Azure app.
  4. In Settings, specify the Allowed Callback URLs as provided by Torq, such as https://app.torq.io/__/auth/handler or its EU equivalent: https://app.eu.torq.io/__/auth/handler.

  5. Note the Domain, Client ID, and Client Secret from the Basic Information section for later use.

Create a Rule for Entra ID Group Claims

To ensure Torq receives Entra ID group memberships as part of the authentication process:

  1. Navigate to Auth Pipeline > Rules in Auth0.

  2. Create > Empty Rule and name it (e.g., Torq Token Group Enrichment).

  3. Replace <ApplicationClientID> in the script with your application's Client ID to conditionally apply this rule:

    function enrichTorqToken(user, context, callback) {
    if (context.clientID !== '<ApplicationClientID>') return;
    const namespace = "https://torq.io/";
    context.idToken[namespace + 'groups'] = user.groups;
    callback(null, user, context);
    }

    This script adds the user's groups to the ID token, facilitating role-based access control in Torq based on Entra ID group memberships.

Set Up SSO in Torq

Configure SSO in Torq

Sign in to Torq as an Owner to perform the following steps.

  1. Access SSO Settings: Go to Settings > Security > Configure SSO.

  2. Select Protocol and Identity Provider: In the IdP Selection section, choose OpenID Connect as the protocol and select Auth0 as your Identity Provider.

  3. Click Next to continue.

  4. Enter IdP Setup Details: In the IdP Setup section, fill in the following fields with the values obtained from Auth0, then click Next to define claims mappings (see below).

Field

Value

Login Redirect URL

US: https://app.torq.io/__/auth/handler
EU: https://eu.app.torq.io/__/auth/handler

Client ID

Copied from Auth0

Client Secret

Copied from Auth0

Issuer URL

Copied from Auth0

Requested Scopes

Permissions your application requests from the identity provider

Code flow

A secure, two-step process where an authorization code is exchanged for tokens on the server side

Implicit flow

Tokens are returned directly in the browser

Send login hint to SSO provider

Optionally sends the user’s email or username as a login hint to the SSO provider

When using Safari v16.1 or newer, the Login Redirect URL must be:
https://app.torq.io/__/auth/handler
If this value differs, contact Torq Support to update the URL for your workspace before continuing.

Define SSO Claims Mapping

The Claims Mapping determines which Torq role is assigned to each user based on identity provider attributes.

  1. Add Claim Mapping Rules: In the Claims Mapping section, click Add Claim to create a new rule.

    • The wizard automatically offers the first mapping, email, marked as recommended.

    • This field is auto-filled with the email address of the current user (the Owner performing the setup).

    • You can optionally edit this initial mapping before saving.

    • After editing, click Add to move the mapping into the saved section.

  2. Provide Mapping Details: For each rule, define the following:

    • Claim Name: The field from your IdP (for example, email or groups).

    • Claim Value: The expected value of the claim (case-sensitive).

    • Assigned Role: The Torq role to assign (for example, Admin, Editor, Viewer).

  3. Organize Claim Priority:

    • Mappings are evaluated top-down.

    • Place the claim with the highest privilege role at the top.

    • Lower-privilege mappings should follow in descending order.

    • A user’s role is determined by the first matching claim.

  4. Save Configuration: After defining all required mappings, click Save to complete the setup.

Important!
The first email claim mapping is essential to prevent account lockouts in Torq. Do not delete it until SSO has been tested and verified with other users, as any misconfiguration in Torq or your IdP could result in loss of access.

Did this answer your question?