This guide walks you through configuring Microsoft Entra ID as an OIDC Identity Provider for Barndoor. Once complete, your users will be able to sign in to Barndoor with their Entra ID credentials and their group memberships will flow through for automatic role mapping.
Prerequisites:
Admin access to your Barndoor account
Admin access to a Microsoft Entra ID tenant (Global Administrator or Application Administrator role)
Your Entra Tenant ID handy (find it on the Entra Overview page)
For the generic, IdP-agnostic version of this flow (Okta, Google Workspace, JumpCloud, etc.), see the Connect your IdP guide.
Still on Token configuration, click + Add groups claim.
2
Choose which groups to include
Pick one of:
Security groups or All groups — simple, includes every group the user is in.
Groups assigned to the application — recommended for larger tenants; only sends groups that have been explicitly assigned to the Barndoor app. This keeps the token small and limits exposure.
3
Set the group identifier to sAMAccountName
Under ID, Access, and SAML sub-sections, change Group ID to sAMAccountName.
Optionally, also tick Emit groups as role claims — this sends groups as roles instead of groups. By default Barndoor maps them as groups, which is what most teams want.
Only set essential: true on the entry inside idToken. Do not mark it essential in accessToken or saml2Token.
3
Add cloud_displayname for groups
Find each groups entry (you’ll see sam_account_name listed) and add cloud_displayname to additionalProperties. Do this in all three of idToken, accessToken, and saml2Token:
From the left nav, click API permissions → + Add a permission → Microsoft Graph → Delegated permissions.Tick the following four scopes:
email
offline_access
openid
profile
Click Add permissions.
2
Grant admin consent
Back on the API permissions screen, click Grant admin consent for your tenant and confirm. The Status column should flip to green checkmarks for all four scopes.
Go to Certificates & secrets → Client secrets tab → + New client secret.
Description: e.g. Barndoor SSO
Expires: Max the value (24 months at time of writing). Entra requires an expiration.
Click Add.
2
Copy the Value immediately
Once the secret is created, copy the Value column (not the Secret ID) to your clipboard.
Entra only displays the secret value once. As soon as you navigate away from this page it is masked permanently. If you miss it, you’ll need to delete the secret and create a new one.
Mark your calendar. When the secret expires (24 months max), SSO will silently break. Rotate it in Entra and update Barndoor’s IdP config before the expiration date.
You’ll need three more values from Entra before switching over to Barndoor.
1
Get the Application (client) ID
Go back to Overview. Copy the Application (client) ID. Also note your Directory (tenant) ID — you’ll need it in Step 9.
2
Get the Authority URL from Endpoints
Still on Overview, click Endpoints in the top bar. A side panel opens with a list of URLs. Copy the OpenID Connect metadata document / Authority URL (the first one, ending in /v2.0/.well-known/openid-configuration or similar).You’ll use this URL in Barndoor to auto-discover the OIDC endpoints — but you’ll then override the Issuer field with a different URL in Step 9. Read on.
Step 9: Set the Issuer URL — the part that trips everyone up
This is the single most important step in this guide. Entra publishes one URL in its metadata, but stamps a different URL into the iss claim of every token it issues. Barndoor verifies the iss claim against the issuer URL you provide, so the two must match exactly — including a trailing slash.
1
Use the Authority URL to auto-discover endpoints
Paste the Authority URL from Step 7 into the Issuer URL field. Barndoor will use it to auto-fill Authorization URL, Token URL, JWKS URL, etc.
2
Now overwrite the Issuer URL
Replace the value in the Issuer URL field with:
https://sts.windows.net/<your-tenant-id>/
Substitute your Directory (tenant) ID from Step 7. The trailing slash is required.
Trailing slash is mandatory. Entra mints tokens with iss: "https://sts.windows.net/<tenant-id>/" (with the slash). If you omit it, every login will fail token validation with a wrong issuer from token error and there will be no useful surface-level UI feedback — you’ll only see it in the Identity Provider logs.This URL is not advertised in Entra’s metadata. You have to set it manually.
3
Save the connection
Click Save connection. Barndoor will store the configuration and reveal the Redirect URI in Step 2 of the setup wizard.
On the Barndoor SSO setup page, you’ll see a Redirect URI that looks like https://auth.barndoor.ai/realms/.../broker/<your-idp-name>/endpoint. Click the copy icon.
2
Add it to Entra's Authentication settings
Back in your Entra app registration, click Authentication in the left nav → + Add a platform → Web.Paste the Redirect URI into the Redirect URIs field, then click Configure.
Leave the Front-channel logout URL and Home page URL fields empty. Entra’s initiate-login behavior doesn’t interoperate with Barndoor’s flow today; setting these can cause confusing redirect loops.
Back in Barndoor’s IdP setup, click Test SSO. A popup window opens and should redirect you to Entra’s sign-in page.
2
Sign in with an Entra user
Complete authentication. You should be returned to Barndoor with a success state on all four readiness pills (Connection: Good, Verification: Ready to test, Role mapping: Optional, Enforcement: Ready to set).
SSO is wired up. Users can now log in to Barndoor with their Entra ID credentials.
Entra Free tier caveat. On Entra ID Free (which most trial tenants use), the cloud_displayname property added in Step 4 is silently ignored and groups arrive as UUIDs rather than human-readable names. Group claims still work — they just aren’t pretty.To get group display names in tokens you need Entra ID P1 or higher. If you’re stuck on Free, you have two options:
Enter group Object IDs (UUIDs) in Barndoor’s role mapping configuration instead of group names. They’re stable per-group, just ugly.
Use Emit groups as role claims (Step 3) which sends groups under the roles claim — Barndoor handles both.
Cause: The Issuer URL in Barndoor doesn’t exactly match the iss claim Entra stamped into the token.Fix: Ensure the Issuer URL is https://sts.windows.net/<tenant-id>/ — including the trailing slash. The login.microsoftonline.com/<tenant-id>/v2.0 URL from Entra’s metadata document is not the issuer; only use it for auto-filling the discovery endpoints. See Step 9.
Test SSO loops or returns silently with no user info
Common causes:
The email claim isn’t in the ID token. Re-check Step 2 and confirm essential: true is set in the manifest under idToken only (Step 4).
The user signing in doesn’t have an email attribute populated in Entra. Verify on the user’s profile.
Fix: Check Barndoor’s Identity Provider logs for the missing-claim error and reconcile against Steps 2–4.
Groups appear as UUIDs instead of names
Cause: Entra ID Free does not honor the cloud_displayname additional property — it’s a paid-tier feature.Fix: Either upgrade to Entra ID P1+, configure Barndoor role mapping against Object IDs, or switch the groups claim to emit as roles (Step 3).
SSO worked, then suddenly stopped
Cause: Most likely the Entra client secret expired. Entra caps secrets at 24 months and SSO breaks silently the moment they roll over.Fix: Rotate the secret in Certificates & secrets, copy the new Value, and update it in Barndoor’s IdP settings. Set a calendar reminder a few weeks before the next expiration.
Redirect URI mismatch on login
Cause: The Redirect URI registered in Entra’s Authentication settings doesn’t exactly match the one Barndoor is sending.Fix: In Barndoor, recopy the Redirect URI from Step 2 of the SSO setup wizard. Paste it into Entra’s Authentication → Web → Redirect URIs. URLs are case- and trailing-slash-sensitive.