This guide walks you through setting up OpenID Connect (OIDC) single sign-on between TrueFoundry and a Keycloak realm. Once finished, members of the realm can sign in to TrueFoundry through a Login with Keycloak button.Documentation Index
Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A TrueFoundry tenant with Admin access to Platform → Settings → SSO.
- A Keycloak deployment (self-hosted or managed) with admin access to the realm you want to federate.
- The Keycloak realm reachable from TrueFoundry’s login service over HTTPS.
Configuration overview
Create an OIDC client in Keycloak
Register a confidential client in the realm you want users to sign in with.
Step 1 — Register a client in Keycloak
Open Clients
Sign in to the Keycloak admin console and select the realm you want to federate from the realm dropdown in the top-left.In the left navigation, click Clients, then Create client.
Configure general settings
On the General settings step:
- Client type: select OpenID Connect.
- Client ID: enter
truefoundry(or any other identifier you prefer). - Name (optional): a display name such as
TrueFoundry.
Configure capability
On the Capability config step:
- Client authentication: toggle On (this makes the client confidential and unlocks the Client Secret you’ll need later).
- Authorization: leave Off unless you specifically use Keycloak Authorization Services.
- Authentication flow: check Standard flow, Direct access grants, and OAuth 2.0 Device Authorization Grant.
Step 2 — Copy the Client Secret
Step 3 — Build the Issuer URL
Keycloak’s OIDC discovery URL for a realm follows this pattern:https://sso.acme.com and the realm is named engineering, the issuer is:
On older Keycloak (≤ 17) the path was
/auth/realms/<realm-name>. Newer versions drop the /auth prefix by default. Use whichever path your deployment actually serves — you can verify by opening https://<keycloak-host>/realms/<realm-name>/.well-known/openid-configuration in a browser.Step 4 — Configure TrueFoundry
Fill in the SSO form
- Enabled: turn this on.
- Name: a label such as
Keycloak OIDC. - SSO Provider: select Custom.
- Authentication Configuration: choose OIDC.
- Client ID: the client ID you set in Keycloak (for example,
truefoundry). - Client Secret: the secret copied from the Credentials tab.
- Discover endpoints: leave enabled.
- Issuer URL: the value you built in Step 3, for example
https://sso.acme.com/realms/engineering. - Scopes (optional): leave blank to use the default
openid email. Addprofilefor first/last name, orgroupsif you’ve added a Keycloak mapper that exposes group memberships.
Encryption algorithm restrictions
How to disable the RSA-OAEP key provider in Keycloak
How to disable the RSA-OAEP key provider in Keycloak
- In the Keycloak admin console, open the realm you’re federating and click Realm settings in the left navigation.
- Switch to the Keys tab.
- Click the Providers sub-tab.
- Locate any provider whose Algorithm column shows
RSA-OAEP(commonly namedrsa-enc-generatedor similar). - Click the provider, set Enabled to Off, and click Save.
Step 5 — Test single sign-on
- Open a private/incognito window and visit your TrueFoundry login page.
- Click Login with Keycloak (or whichever button label you chose under Show advanced fields → Button Text).
- Authenticate with a Keycloak user from the federated realm.
Troubleshooting
'Failed to discover endpoints' or HTTP 404 on the issuer
'Failed to discover endpoints' or HTTP 404 on the issuer
The realm name in the Issuer URL is wrong, or your Keycloak still uses the
/auth prefix. Open https://<keycloak-host>/realms/<realm-name>/.well-known/openid-configuration in a browser:- If it returns JSON, copy the
issuerfield verbatim into TrueFoundry. - If you get a 404, try
https://<keycloak-host>/auth/realms/<realm-name>/.well-known/openid-configurationand use that prefix instead.
'Invalid redirect_uri' from Keycloak
'Invalid redirect_uri' from Keycloak
The exact URL
https://login.truefoundry.com/oauth2/callback is missing from Valid Redirect URIs on the Keycloak client. Add it under Clients → your client → Settings, save, and retry.'Failed to decrypt ID token' / 'unsupported algorithm RSA-OAEP'
'Failed to decrypt ID token' / 'unsupported algorithm RSA-OAEP'
Your realm is issuing tokens encrypted with
RSA-OAEP, which TrueFoundry does not support. Follow the steps in the encryption algorithm restrictions section above to disable the RSA-OAEP key provider, leaving only supported algorithms enabled.'Invalid client credentials'
'Invalid client credentials'
The Client Secret in TrueFoundry doesn’t match Keycloak. Regenerate the secret on the client’s Credentials tab, copy the new value, and update TrueFoundry → Platform → Settings → SSO.
Sign-in works but the user's email is empty
Sign-in works but the user's email is empty
Make sure the email scope is being requested and that the user has an email in Keycloak. In the TrueFoundry SSO form, set Scopes to
openid email profile and re-test. If you map email under a non-standard claim, expand Show advanced fields and set Email Claim accordingly.