Enable single sign-on for TrueFoundry with identity providers like GSuite, Azure AD, Okta, or Keycloak.
TrueFoundry allows your team to enable SSO with your Identity Provider (IdP) by leveraging OpenID Connect (OIDC) or Security Assertion Markup Language (SAML). TrueFoundry SSO integration provides a seamless way to sign in with your own IdPs and also eliminates the need for employees to maintain/enter credentials.TrueFoundry can integrate with the following IdP providers: GSuite, AzureAD, Okta, Keycloak
If you don’t see the name of your IdP provider above, there is a high chance
your IdP is also supported as long as it support OpenID Connect (OIDC) or SAML
protocol.
Truefoundry maintains a centralized Authentication Server that handles the authentication flow to the platform (as described here). The SSO integration of your IDP is done by configuring the Authentication Server to use your IdP as the Identity Provider. This helps us control the licensing and track the number of users accessing the platform.When a user logs into the control plane, the control-plane redirects to login.truefoundry.com, which is the Authentication Server. The Authentication Server then redirects to the IdP’s login page, which then redirects back to the Authentication Server with an authorization code. The Authentication Server then uses this authorization code to fetch user information from the IdP and create a new user in the platform if they don’t exist. The user is then redirected to the control plane with the authentication tokens. The flow of the request is described as follows:
1
Request Login Page
Browser initiates the OAuth flow by requesting the login page from TrueFoundry Control Plane, with the redirect URL being the TrueFoundry Control Plane URL.
Example Request/Response
Request
Copy
Ask AI
GET /api/svc/v1/oauth2/authorize?tenantName={tenant_name} &controlPlaneURL=https%3A%2F%2Fyour.example.com &redirectURL=https%3A%2F%2Fyour.example.com%2Fauth%2FcallbackHTTP/1.1Host: your.example.com
Browser redirects to the Login Page URL powered by . The login page provides an interactive form for the user to choose the type of authentication, such as password-based or SSO.
3
Redirect to SSO Identity Provider page
On selecting SSO, the browser is redirected to the SSO Identity Provider’s login page with the redirect URL as the
All requests to the Identity Provider are signed using a RS256 key pair. In case of SAML, destination assertion is enabled ensuring secure transfer of user authentication information between the SAML identity provider (IdP) and TrueFoundry Auth Server (SP).
4
Redirect to the TrueFoundry Auth Server with code
On successful authentication by SSO Identity Provider, the browser redirects to the configured redirect URL, i.e. , with an authorisation code. The Auth server then uses this authorisation code to fetch user information using a POST HTTP request to the SSO Identity Provider.
Example Request/Response
Request
Copy
Ask AI
GET /oauth2/callback?code={authorization_code}&state={encoded_state}HTTP/1.1Host: login.truefoundry.com
To protect data integrity and privacy, all data in transit to and from TrueFoundry Control Plane or Auth Server is encrypted using TLS 1.2 or higher.
5
Validate & Create User if it doesn't exist
validates the response from the SSO Identity provider and maps the user based on the email claim with the user’s email in the database, and creates a new entry if not present already.
Example Request/Response
This step is performed by the and is not visible to the user.Get Token from SSO Identity Provider:
Request
Copy
Ask AI
POST /oauth2/{client_id}/v1/tokenHTTP/1.1Host: example.sso.comContent-Type: application/x-www-form-urlencodedOrigin: https://login.truefoundry.comBody: code={authorization_code} &grant_type=authorization_code &redirect_uri=https://login.truefoundry.com/oauth2/callback
On successful code validation, responds with authentication tokens that include an access token and a refresh token, signed by .
By default, the access token is valid for 1 day and the refresh token is valid for 7 days. You can change the token expiry by contacting support.
9
Set tokens as an HttpOnly Cookie
TrueFoundry Control Plane sets these authentication tokens as HTTP-only cookies in the Browser. All further requests to TrueFoundry Control Plane contain the same cookies and are used for authentication and authorisation at the API server layer
Go to Platform -> Settings -> SSO, toggle Enabled, pick your SSO Provider (Okta, Google, Azure AD, or Custom), then choose OIDC or SAML v2 under Authentication Configuration.You can enable the SSO settings and fill up the form with the fields as described below:You can choose any of the SSO providers: Google, AzureAD, Okta, or custom (KeyCloak can be integrated using Custom). In case you are using any of the above, you can read our specialized documentation for each of them:
In case you don’t find the guide above, you can follow the steps below for OIDC and SAML v2:
OpenID Connect (OIDC)
SAML v2
1
Create a client application in your IdP
Set the redirect/callback URL to
https://login.truefoundry.com/oauth2/callback
2
Fill up the TrueFoundry SSO settings form
Fill up the TrueFoundry SSO settings form with the fields as described
below: - Client ID - Client Secret - Discover endpoints — If you
enable this as True, we will automatically discover the endpoints from the
issuer URL. If you mark this as disabled, you will need to manually set the
Authorization Endpoint, Token Endpoint and UserInfo Endpoint - Issuer URL - your IdP’s issuer - used with discovery to auto‑populate endpoints. -
Scopes - Space separated list of scopes. Defaults to openid email
1
Create a service provider in your IdP
When adding ACS / Single sign‑on URL or Audience / SP Entity ID you can use placeholder values for now and update it once you save the configuration in TrueFoundry.
2
Simplify claim configuration with attribute mapping(Optional)SAML identity providers often use complex, vendor-specific attribute names for user information. For example, attributes like http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress or http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier require you to configure custom claim names in TrueFoundry’s advanced settings.Recommended approach: Configure attribute mapping in your IdP to use standard, simple names that match TrueFoundry’s defaults:
Attribute Name
Map to
Purpose
sub
Your IdP’s user ID field
User’s unique identifier
email
Your IdP’s email field
User’s email address
groups
Your IdP’s groups field (if supported)
User’s group memberships for RBAC
This allows TrueFoundry’s default settings to work automatically without needing to specify custom claim names in the advanced settings.
3
Fill up the TrueFoundry SSO settings form
Fill up the TrueFoundry SSO settings form with the fields as described below:
TrueFoundry supports SCIM (System for Cross-domain Identity Management) to automatically create and update users and groups from your identity provider. SCIM provisioning is available for SAML v2 SSO configurations.
SCIM enables automatic user lifecycle management — when you add or remove
users in your identity provider, TrueFoundry will automatically sync those
changes.
Steps to configure SCIM:
Group name format: Only alphanumeric characters and ”-” are allowed. Group names can be up to 36 characters in length.
1
Enable SCIM when creating SAML SSO
When configuring a new SAML v2 SSO provider, check the Enable SCIM checkbox at the bottom of the authentication configuration form.
2
Save the SSO configuration
Complete the SAML configuration with your Identity Provider Endpoint and X.509
Certificate, then save the configuration.
3
Get the SCIM URL
After saving, expand your SSO configuration to view the SCIM URL along with other metadata. Copy this URL — you’ll need it for your identity provider’s SCIM settings.
4
Get the SCIM Token
Click the key icon (Get SCIM Token) next to your SSO configuration to generate and copy the SCIM authentication token.
Store this token securely. You’ll need it to authenticate SCIM requests from your identity provider.
5
Configure your Identity Provider
In your identity provider’s SCIM provisioning settings:
Set the SCIM Base URL to the SCIM URL from TrueFoundry