Area: Deployment Issues
Sub-Area: SSO / OIDC Authentication Configuration
Applies to: OSS + Cloud
Issue
You set up OpenID Connect (OIDC) single sign-on with Microsoft Entra ID (formerly Azure AD). Entra's sign-in logs show a successful sign-in, but DataHub sends the user back to the login page with this message:
Failed to sign in using Single Sign-On provider. Please try again, or contact your DataHub Administrator.
DataHub shows this one message for several different failures. The real error is in the datahub-frontend logs. The most common log errors for Entra are:
Bad token response, error=invalid_clientFailed to resolve user name claim from profile provided by Identity Provider. Missing attribute. Attribute: '<claim>', Regex: '<regex>', Profile: {...}Failed to extract DataHub username from username claim <value> using regex <regex>. Profile: {...}
You Might Be Asking
- Why does Entra show a successful sign-in when DataHub still fails?
- What does
invalid_clientmean for DataHub OIDC SSO? - Which value should I use for User Name Claim with Entra?
- Why is the
emailclaim missing for my users? - Which redirect URI do I register in Entra?
Cause
Entra authenticates the user first. DataHub then exchanges the sign-in code for tokens and builds a user profile from the ID token and the UserInfo response. The login fails after the Entra sign-in when one of these steps fails:
- The token exchange fails because Entra rejects the Client ID or Client Secret. DataHub logs
Bad token response, error=invalid_client. - The profile does not contain the claim set in User Name Claim. DataHub logs
Failed to resolve user name claim ... Missing attribute. The log line lists every attribute in the profile, so it shows which claims Entra did send. - The User Name Claim Regex does not match the claim value.
Other problems show a different message:
- When Entra sends an error back to DataHub instead of a sign-in code (for example, a declined consent), DataHub shows Entra's error code and description on the page. For
access_denied, the page starts withAccess denied. The OIDC service responded with 'Access denied'.For other errors, it starts withInternal server error. The OIDC service responded with an error:. - When pre-provisioning is on and the user does not exist in DataHub, the page shows
Failed to perform post authentication steps. Error message: User with urn urn:li:corpuser:<username> has not yet been provisioned in DataHub. Please contact your DataHub admin to provision an account.
Solution
Get the exact error first. On a self-hosted deployment, search the datahub-frontend logs at the time of the failed login. On DataHub Cloud, you cannot see these logs: contact DataHub Support and give the exact time of a failed login and the user who tried. Then follow the step for that error.
Where to change settings:
- DataHub Cloud: Settings > Platform > SSO > OIDC. User Name Claim, User Name Claim Regex and Scope are under Advanced. See Enable OIDC SSO.
- Self-hosted: the
AUTH_OIDC_*environment variables ondatahub-frontend, then restart it. See Configuring OIDC Authentication.
-
invalid_client: fix the Client Secret and Client ID.- In the Azure portal, open App registrations, then your DataHub app, then Certificates & secrets.
- Check the expiry of the secret. Create a new client secret if it expired or if you are not sure which value you entered.
- Copy the secret Value, not the Secret ID. Azure shows the Value only once.
- Paste it into Client Secret in DataHub (self-hosted:
AUTH_OIDC_CLIENT_SECRET). - Check that Client ID in DataHub (self-hosted:
AUTH_OIDC_CLIENT_ID) is the Application (client) ID from the app's Overview page.
-
Missing attribute: make User Name Claim match a claim that Entra sends.
- Read the
Profile: {...}part of the log line. It lists the claims DataHub received. Pick a claim from that list. - The DataHub Cloud SSO form fills User Name Claim with
preferred_username. On self-hosted DataHub, the default isemailwhenAUTH_OIDC_USER_NAME_CLAIMis not set. -
preferred_usernameis in Entra v2.0 tokens when the scope includesprofile. - If you use
email, the scope must includeemailand the user's Entra account must have an email address. You can also addemailas an optional claim for the ID token under Token configuration in the app registration. - Use a claim name, not a scope name.
openidis a scope, soopenidas User Name Claim always fails. - Changing User Name Claim or User Name Claim Regex changes the username DataHub derives. A user whose username changes gets a new DataHub account without their old roles, groups or ownership. Choose the claim and regex that produce the usernames your users already have.
- Read the
-
Check the scope. The scope must include
openid,emailandprofile. The DataHub Cloud form default isopenid email profile. The self-hosted default isopenid profile email. -
Check API permissions and consent.
- In the app registration, open API permissions. Under Microsoft Graph delegated permissions, add
openid,profile,emailandUser.Read. See Azure AD prerequisites. - If DataHub shows an Entra consent error such as
AADSTS65004(user declined consent), grant admin consent for your tenant on the API permissions page. Users then do not see a consent prompt.
- In the app registration, open API permissions. Under Microsoft Graph delegated permissions, add
-
Register the exact redirect URI.
- The redirect URI is your DataHub base URL followed by
/callback/oidc, for examplehttps://<your-instance>.acryl.io/callback/oidc. On self-hosted DataHub, it isAUTH_OIDC_BASE_URLfollowed by/callback/oidc. - On DataHub Cloud v2.3.0 and later, the OIDC settings page shows the Redirect URI with a Copy button. Saving the SSO settings records the browser address you saved from as the base URL. Save from your normal DataHub URL so the redirect URI does not change.
- In the Azure portal, add that exact URI under Authentication, as a Web redirect URI. Entra rejects a URI that is not registered with error
AADSTS50011.
- The redirect URI is your DataHub base URL followed by
-
Check the Discovery URI. It must be
https://login.microsoftonline.com/<tenant-id>/v2.0/.well-known/openid-configuration, with the Directory (tenant) ID from the app's Overview page. Open it in a browser to confirm it returns a JSON document. On self-hosted DataHub, thedatahub-frontendcontainer must also be able to reach it. -
Check the provisioning strategy. Just-in-Time (JIT) provisioning is the default and creates the DataHub user at first login. If Pre-Provisioning DataHub Users is selected (self-hosted:
AUTH_OIDC_PRE_PROVISIONING_REQUIRED=true), the user must already exist in DataHub with the same username that User Name Claim produces.
Related Documentation
- Enable OIDC SSO (DataHub Cloud)
- Prerequisites for OIDC Authentication: Azure AD
- Configuring OIDC Authentication (self-hosted)
- OIDC troubleshooting
Tags: sso, oidc, azure-ad, microsoft-entra, authentication, invalid_client, userNameClaim, admin-consent, redirect-uri