Skip to content

Microsoft Entra ID ​

designIQ signs people in with your OIDC identity provider. With Microsoft Entra ID, the browser sign-in and AI clients (MCP) can both sign in at Entra ID directly; a Keycloak in front of it is the alternative where the direct route does not fit:

SetupBrowser sign-inAI clients (MCP)
Entra ID directly (recommended)yesyes, with an app registration for them: Claude Code, the Live Host's host name on a domain verified in your tenant
Keycloak brokering Entra IDyesyes, with the client the administrator registers: for a host name on no verified domain, or clients that need dynamic client registration

In both, Entra ID decides who may sign in, and the git provider decides what each person may do: the login claim names the person's GitLab username (or GitHub login), and designIQ asks GitLab (GitHub) about their access to each repository with the platform's own credential (configuration.md). Entra ID knows nothing about repositories.

What Entra ID does differently ​

Checked against Microsoft's documentation and Entra ID's live endpoints on 2026-11-30:

  • Only the OpenID Connect scopes, and the access token is Microsoft Graph's. With scope=openid profile email (designIQ's default) Entra ID issues an access token for Microsoft Graph: aud is 00000003-0000-0000-c000-000000000000, its header carries a nonce, and no one but Graph can verify its signature. designIQ verifies the access token of the sign-in, so it needs a scope of its own app registration in LIVE_OIDC_SCOPE (openid profile email api://<client id>/designiq.access). A host whose LIVE_OIDC_ISSUER is Entra ID and whose LIVE_OIDC_SCOPE names no such scope does not start, and says this.
  • The token's version follows the app registration, not the endpoint: the manifest's requestedAccessTokenVersion (accessTokenAcceptedVersion in the older manifest format) is null (v1) on a new registration. A v2 token is issued by https://login.microsoftonline.com/<tenant id>/v2.0 for the client id (aud); a v1 token by https://sts.windows.net/<tenant id>/ for the App ID URI (api://<client id>). The issuer and the audience tell the versions apart, not the keys: for a tenant, Entra ID lists the same signing keys at both key addresses (discovery/keys and discovery/v2.0/keys). Set the version to 2 and use the v2 values below.
  • The issuer names the tenant: a single-tenant app registration, and LIVE_OIDC_ISSUER with the tenant id, never common or organizations.
  • No email in an access token unless an optional claim asks for it, and none is needed: designIQ reads the login claim and the display name (name, with the profile scope). preferred_username (v2) and upn (v1) hold the person's sign-in name, an address such as erika.mustermann@acme.example, which is no GitLab username, and Microsoft says not to authorize on preferred_username (it can change). The GitLab username comes from a directory extension attribute, emitted as the claim extn.<name>; who can write it is more than your administrators (step 7).
  • AI clients need a scope, and their resource must be an Application ID URI. MCP clients ask for the scopes the Live Host advertises (LIVE_MCP_SCOPES) and send the resource <LIVE_PUBLIC_URL>/mcp beside them (RFC 8707, which the MCP specification requires). Entra ID refuses a request without a scope (AADSTS900144), and a resource that is no Application ID URI of the application the scope belongs to (invalid_target, AADSTS9010010): it compares the resource with each of that application's identifier URIs and its client id, tolerates a trailing slash, and refuses a path under one. So designIQ's app registration gets https://<host>/mcp as an Application ID URI, as Microsoft's guide to MCP servers says: "Set the Application ID URI to the MCP server's canonical endpoint URL" (Microsoft: secure an MCP server with Entra ID). An https identifier URI must be on a domain verified in your tenant: "a tenant verified or initial domain may still be required in some scenarios - for example, when using the https:// scheme" (Microsoft: identifier URI restrictions). The Live Host's host name has to be under such a domain.
  • No dynamic client registration, and no metadata where AI clients look first. The discovery document is served only at <issuer>/.well-known/openid-configuration; the RFC 8414 address (/.well-known/oauth-authorization-server/<tenant id>/v2.0) answers 404. It names no code_challenge_methods_supported (PKCE works all the same), no none among the token endpoint's client authentications and no registration_endpoint. AI clients therefore sign in with a client id registered ahead, an app registration of their own. Claude Code and the MCP client library find the document at the third address they try, and go on without code_challenge_methods_supported, which the MCP specification (2025-11-25) tells clients to require; a client that requires it needs the broker.

Why the access token, not the ID token ​

The Live Host verifies the access token of a browser sign-in, as it verifies an AI client's bearer, and not the ID token. One identity contract serves both entrances: what an administrator configures for the browser (audience, login claim, the cell's tenant claim) works for AI clients unchanged, and a misconfiguration shows at the first sign-in, not when the first AI client connects. The ID token is meant for the client, the access token for the resource server, which designIQ is for AI clients in any case. Verifying the ID token would spare Entra ID the exposed API, but at the price of a second claim contract (the ID token's claims, a nonce), a browser sign-in that works where AI clients then fail, and the hosted service's tenant claim, which its IdP's JWT template puts into the access token. The cost on Entra ID's side is one exposed scope in the app registration.

Entra ID directly ​

The browser sign-in with Entra ID as the identity provider. AI clients sign in at the same issuer with their steps on top of these.

The app registration, step by step ​

In the Microsoft Entra admin center, as at least a Cloud Application Administrator:

  1. App registrations > New registration. Name designIQ; supported account types: Accounts in this organizational directory only (single tenant); redirect URI, platform Web: https://<LIVE_PUBLIC_URL host>/auth/oidc/callback. Note the Application (client) ID and the Directory (tenant) ID of the overview.

  2. Authentication. For LIVE_OIDC_LOGOUT=idp add https://<host>/ as a further Web redirect URI: Entra ID only sends the browser back to a registered address after the sign-out. Leave Allow public client flows off: the Live Host is a confidential client.

  3. Certificates & secrets > New client secret. Its value is shown once: it becomes LIVE_OIDC_CLIENT_SECRET. A secret expires (Entra ID offers up to 24 months; choose what your policy says) and every sign-in fails from that day: the person reads "sign-in could not be completed", the Live Host's log oidc login: code exchange → 401: ... AADSTS7000222 .... Put the renewal in a calendar with the person who does it, create the new secret before the old one expires, and restart the Live Host with it.

  4. Expose an API. Application ID URI > Add: keep api://<client id>. Add a scope: name designiq.access, who can consent Admins only, a display name and description such as "Use designIQ", state enabled.

  5. API permissions > Add a permission > My APIs > designIQ > designiq.access, then Grant admin consent for (your tenant), so nobody is asked to consent at the first sign-in.

  6. Manifest. Set "requestedAccessTokenVersion": 2 in the api section (in the older manifest format: "accessTokenAcceptedVersion": 2). Without it the tokens are v1 and the sign-in says so.

  7. The login claim. Create a directory extension attribute for the GitLab username on this app registration (Microsoft Graph: POST /applications/<object id>/extensionProperties with {"name": "gitlabUsername", "dataType": "String", "targetObjects": ["User"]}), set it for each person with Microsoft Graph or PowerShell, and emit it in the access token: in the manifest's optionalClaims.accessToken, {"name": "extension_<client id without dashes>_gitlabUsername", "source": "user"}. The token carries it as extn.gitlabUsername ("Within the JWT, these claims are emitted with the following name format: extn.<attributename>", Microsoft: optional claims). What decides whether this claim can be trusted:

    • One spelling of the name. "Extension attribute names aren't case sensitive when being set up, but they are case sensitive when being read from the directory by the token service" (Microsoft: directory extension attributes in claims): a person whose value was written under another spelling gets no claim, and the Live Host refuses them.
    • Entra Connect does not fill this attribute. An extension synced from your on-premises directory belongs to Entra Connect's application, not to designIQ's: "Directory extension attributes created and synced using Microsoft Entra Connect are always associated with the application ID used by Microsoft Entra Connect", and "If an application needs to send claims with data from an extension attribute that's registered on a different application, a claims mapping policy must be used to map the extension attribute to the claim" (the same page). A claims mapping policy needs acceptMappedClaims (single tenant) or a custom signing key, else Entra ID answers AADSTS50146 (Microsoft: claims customization). acceptMappedClaims also bounds the token's audience: "AcceptMappedClaims is only supported for a token audience matching the application GUID or an audience within the tenant's verified domains" (AADSTS501461, the same page). designIQ's v2 tokens meet that (their aud is the client id); the v1 path below (aud api://<client id>) does not. The mapped claim needs a name without the extn. prefix, which Entra ID reserves (Microsoft: claims customization reference); set LIVE_OIDC_LOGIN_CLAIM to that name. Untested here: only your tenant shows the mapped claim in a token (below). This step's optional claim works only for an extension registered on designIQ's own app registration.
    • Who can write the value decides whose GitLab rights a person gets. Not only your administrators: "All authorized applications in the tenant can read and write data on any extension properties defined on an instance of the target directory object", and "in a delegated scenario, an app can update any user's extension data only if it's granted the User.ReadWrite.All permission and the signed-in user has a supported Microsoft Entra administrator role" (Microsoft Graph: extensibility overview). Microsoft does not list those roles, so the pentest's list of writers names at least: every Global Administrator; everyone holding a role with microsoft.directory/users/basic/update (User Administrator, Directory Writers, Intune Administrator, Authentication Administrator, Privileged Authentication Administrator, the deprecated Partner Tier1 and Tier2 Support, and any custom role with it: Microsoft: built-in roles); every application holding the application permission User.ReadWrite.All or Directory.ReadWrite.All; and every application with a delegated grant of either, in the hands of anyone holding one of those roles. Which of these roles can write an extension value, and whether people can set their own (PATCH /me with no more than User.ReadWrite), Microsoft does not say. Test both in your tenant before the pilot, in Graph Explorer: someone in each of those roles your tenant assigns writes another person's value, and a person without an administrator role writes their own, with a client that person may consent to. Only 403 Authorization_RequestDenied from the directory counts as a refusal; a consent refusal proves nothing.
    • GitLab usernames must stay put. "By default, users can change their usernames" (GitLab: user settings), and a name freed that way can be taken by someone else: every person whose claim names it then acts with that account's GitLab rights and under its name. Set gitlab_rails['gitlab_username_changing_enabled'] = false in /etc/gitlab/gitlab.rb (the same page), and block the GitLab accounts of people who leave instead of deleting them, which would free their names.
    • A host with a GitHub App beside the GitLab takes the GitHub login the same way (githubLogin) and names two claims: LIVE_OIDC_LOGIN_CLAIM=extn.githubLogin and LIVE_OIDC_GITLAB_LOGIN_CLAIM=extn.gitlabUsername. Everyone then needs a GitHub login in the directory: a token without it is refused, so a person with only a GitLab account cannot sign in at all. Copy each login from your GitHub organization's member list, never a guess: anyone can register a free GitHub login. A GitHub login can be renamed, and "your old username becomes available for anyone else to claim" (GitHub: username changes), which no setting of yours prevents: compare the directory's values with the organization's member list regularly and when someone leaves.
  8. Enterprise applications > designIQ > Properties: Assignment required = Yes, then Users and groups: assign the group of the pilot's people. Without assignment everyone in the tenant can sign in (and sees only the repositories GitLab lets them write).

The Live Host's values ​

bash
LIVE_OIDC_ISSUER=https://login.microsoftonline.com/<tenant id>/v2.0
LIVE_OIDC_JWKS_URL=https://login.microsoftonline.com/<tenant id>/discovery/v2.0/keys
LIVE_OIDC_CLIENT_ID=<application (client) id>
LIVE_OIDC_CLIENT_SECRET=<the client secret's value>
LIVE_OIDC_SCOPE=openid profile email api://<client id>/designiq.access
LIVE_OIDC_AUDIENCE=<application (client) id>
LIVE_OIDC_LOGIN_CLAIM=extn.gitlabUsername
LIVE_OIDC_LOGIN_LABEL=Microsoft
# LIVE_OIDC_LOGOUT=idp   # signs the person out of every Microsoft application in that browser

The authorize and token endpoints come from discovery. The startup report names the tenant, the token version and what AI clients ask for (oidc : Entra ID tenant <id>, v2 tokens, ... AI clients (MCP): ...), warns when LIVE_OIDC_AUDIENCE is unset (a v2 token's audience is the client id, not LIVE_PUBLIC_URL), and warns of each setting AI clients still miss (below).

If the registration must stay on v1 tokens, the host takes those instead: LIVE_OIDC_ISSUER=https://sts.windows.net/<tenant id>/, LIVE_OIDC_JWKS_URL=https://login.microsoftonline.com/<tenant id>/discovery/keys, LIVE_OIDC_AUDIENCE=api://<client id>, and LIVE_OIDC_AUTHORIZE_URL and LIVE_OIDC_TOKEN_URL set to the v2.0 endpoints (https://login.microsoftonline.com/<tenant id>/oauth2/v2.0/authorize and .../token): the v1 issuer's discovery names v1 endpoints, which take no scope, so the host does not start without them.

What the Live Host says when something is off ​

WhereWhat it saysWhat to change
bootLIVE_OIDC_ISSUER is Entra ID, and LIVE_OIDC_SCOPE (...) names no scope of designIQ's ...Expose the API (steps 4, 5) and set LIVE_OIDC_SCOPE. A bare Graph scope (User.Read) counts as none
bootLIVE_OIDC_ISSUER is Entra ID's v1 issuer ...The v2 issuer, or the v1 values above with both endpoint URLs
bootLIVE_OIDC_ALLOWED_CLIENTS does not list LIVE_OIDC_CLIENT_ID (...)Add designIQ's client id: the browser sign-in's token is issued to it
warningLIVE_OIDC_ISSUER is Entra ID and LIVE_MCP_SCOPES is unset: AI clients (MCP) ask Entra ID for no scope ...The AI clients' steps and values
warningLIVE_MCP_SCOPES names <scope>, a scope of <resource>, and AI clients (MCP) send the resource https://<host>/mcp ...The Application ID URI it names (AI clients' step 1), and the scope under it
warningLIVE_MCP_SCOPES (...) names no scope of designIQ's app registration ...The full scope https://<host>/mcp/designiq.access (AI clients' step 1); a bare scope is Graph's
warningLIVE_MCP_CLIENT_ID is unset ..., LIVE_MCP_CLIENT_ID is designIQ's own app registration ...The AI clients' app registration (AI clients' step 2) and its id
warningLIVE_MCP_CLIENT_ID (...) is not in LIVE_OIDC_ALLOWED_CLIENTS ...The AI clients' app id in LIVE_OIDC_ALLOWED_CLIENTS
sign-inthe identity provider issued this token for Microsoft Graph ...LIVE_OIDC_SCOPE (a host whose issuer the check did not recognise)
sign-intoken not issued by the configured IdP (its issuer: https://sts.windows.net/...), Entra ID issued a v1 access tokenrequestedAccessTokenVersion 2 (step 6)
sign-intoken not issued for this resource (its audience: <id>)LIVE_OIDC_AUDIENCE: the client id (v2) or the App ID URI (v1)
sign-intoken carries no 'extn.gitlabUsername' claim ... (the token's claims: ...)The optional claim (step 7), or the person's attribute value; the list names claims, never values
sign-insign-in could not be completed; the log has Entra ID's AADSTS... codeAADSTS7000222: the secret expired (step 3); AADSTS7000215: a wrong secret
bearer401 auth/client-not-allowed, token issued to the client application <id> ...; a security: line in the logThat application's id in LIVE_OIDC_ALLOWED_CLIENTS, if it is one of yours
at EntraAADSTS50011 (redirect URI), AADSTS65001 (consent), AADSTS50105 (not assigned)Steps 1, 5 and 8; for an AI client its steps 2 to 4
AI clientAADSTS900144 (no scope), AADSTS9010010 (the resource), AADSTS500011 (a scope of an identifier URI no app has)LIVE_MCP_SCOPES, and the Application ID URI https://<host>/mcp (AI clients' step 1)
AI clientAADSTS90009 (an application asking for a token for itself)LIVE_MCP_CLIENT_ID: the AI clients' app registration, not designIQ's (AI clients' step 2)

The same refusals answer an AI client's bearer, with the reason in the 401's WWW-Authenticate (error="invalid_token", error_description="..."). The warnings do not stop the host: the browser sign-in works without any of them, and the host cannot see your app registration, so it cannot tell whether a resource is one of its identifier URIs.

AI clients (MCP) at Entra ID directly ​

The recommended route for AI clients: they sign in at Entra ID as the browser does, with your conditional access and MFA, and nothing in between. It needs the Live Host's host name on a domain verified in your tenant, because the Application ID URI below is an https URI with that host name; that only the URI has to be on such a domain, so an internal host name under it will do, is our reading of Microsoft's rules, not tested. Without such a domain, use the broker.

In Entra ID, step by step ​

On top of the browser sign-in's steps 1 to 8 above:

  1. designIQ > Manifest: a second Application ID URI. Keep api://<client id> and add https://<host>/mcp, LIVE_PUBLIC_URL followed by /mcp character for character: "identifierUris": ["api://<client id>", "https://<host>/mcp"]. No trailing slash: "The application ID URI value must not end with a slash" (Microsoft: identifier URI restrictions). The same scope now has a second name, https://<host>/mcp/designiq.access, which AI clients ask for; the browser sign-in keeps api://<client id>/designiq.access.
  2. App registrations > New registration: designIQ AI clients. Single tenant, no redirect URI yet. Then Authentication > Add Redirect URI (the older view: Add a platform), the tile Mobile and desktop applications, custom redirect URI http://localhost/callback (Microsoft: add a redirect URI). Claude Code listens on a port of its own (http://localhost:<port>/callback), and "the port component (for example, :5001 or :443) is ignored for the purposes of matching a localhost redirect URI" (Microsoft: redirect URI restrictions); the path must match. No client secret: it is a public client. Leave Allow public client flows at No: Claude Code signs in with the authorization code and PKCE, and the redirect URI already makes this app a public client ("Microsoft Entra ID infers the application type from the replyUrlsWithType by default", Microsoft: app manifest). The setting would add the device code flow, and "By default, allow public client flow in your app registration should be disabled unless" an app needs that flow (Microsoft: public and confidential clients): with it on, anyone anywhere could start a device code sign-in with this app's id, have a person enter the code, and get a designIQ token in that person's name that LIVE_OIDC_ALLOWED_CLIENTS takes. Note its Application (client) ID: it becomes LIVE_MCP_CLIENT_ID. It has to be an app registration of its own: designIQ's asking for its own scope with the resource https://<host>/mcp is refused, "This scenario is supported only if the resource that's specified is using the GUID-based application ID" (AADSTS90009, Microsoft: error codes).
  3. designIQ AI clients > API permissions > Add a permission > My APIs > designIQ > Delegated permissions > designiq.access, then Grant admin consent for (your tenant). The scope is Admins only (step 4), so nobody can consent to it for themselves.
  4. Enterprise applications > designIQ AI clients > Properties: Assignment required = Yes, and assign the pilot's group, as for designIQ in step 8. Whether Entra ID also checks designIQ's own assignment when this app asks for designIQ's scope, only your tenant shows: set it on both.

The Live Host's values for AI clients ​

On top of the browser sign-in's values above:

bash
LIVE_PUBLIC_URL=https://<host>
LIVE_MCP_SCOPES=https://<host>/mcp/designiq.access
LIVE_MCP_CLIENT_ID=<AI clients application id>
LIVE_OIDC_ALLOWED_CLIENTS=<application (client) id>,<AI clients application id>

LIVE_MCP_SCOPES is what the Live Host's 401 and its protected resource metadata tell AI clients to ask for; LIVE_MCP_CLIENT_ID goes into the Connect an AI client dialog's command. Leave LIVE_MCP_CALLBACK_PORT unset: Entra ID ignores the port. The startup report then reads AI clients (MCP): scope "https://<host>/mcp/designiq.access", resource https://<host>/mcp, client <id>.

LIVE_OIDC_ALLOWED_CLIENTS is optional, and with a pentest ahead we recommend it. Every application in your tenant that has consent for designiq.access gets tokens for designIQ, and without the setting the Live Host takes them all. With it, it takes only the tokens issued to the clients listed (the token's azp; appid in a v1 token): designIQ's own client, whose token the browser sign-in gets, and the AI clients' app. Any other is refused with 401 auth/client-not-allowed and a security: 401 auth/client-not-allowed ... line in the log. An AI client you add later (claude.ai's own app registration, below) needs its id there too. The ids are compared in any case, as Entra ID takes them.

The setting limits app registrations, not software. The id of a public client is no secret: any program can sign in with a listed one, through a localhost redirect on the person's own machine, or through the device code flow from anywhere when that app allows it. That is why the AI clients' app keeps Allow public client flows at No (step 2), and why no client of someone else's that answers the device code flow (VS Code's, below) belongs in the list.

Each person ​

bash
claude mcp add --transport http designiq https://<host>/mcp --client-id <AI clients application id>
claude mcp login designiq

The Connect an AI client dialog hands people the first line for your host. claude mcp login opens the browser: Entra ID's sign-in, with your conditional access and MFA, then back to Claude Code (--no-browser prints the address to open elsewhere); claude mcp list shows designiq connected. Claude Code asks for https://<host>/mcp/designiq.access offline_access and renews its token with a refresh, which the first sign-in in your tenant must confirm (below).

Which AI clients, for the pilot ​

  • Claude Code: supported, with the steps above. What its first sign-in in your tenant must confirm is below.
  • claude.ai and Claude Desktop (custom connectors): only with /mcp reachable from the internet on port 443, because they connect from Anthropic's cloud: "Claude connects to your remote MCP server from Anthropic's cloud infrastructure, rather than from your local device" (Anthropic: custom connectors). Unverified here: a third app registration (platform Web, redirect URI https://claude.ai/api/mcp/auth_callback, a client secret, designiq.access with admin consent) entered under Use your own OAuth client, its id in LIVE_OIDC_ALLOWED_CLIENTS. Someone else reported this working with Entra ID in anthropics/claude-ai-mcp#977 (AADSTS9010010 with short scope names, the fully qualified scope confirmed as the fix).
  • VS Code: not for the pilot. It signs in with its own Microsoft account provider and its own client id, which Microsoft's guide for App Service has the API preauthorize: "In the Client ID field, enter the Visual Studio Code client ID: aebc6443-996d-45c2-90f0-388ff96faa56" (Microsoft: MCP server with VS Code). Do not do that for designIQ: keep it out of designIQ > Expose an API > Authorized client applications and out of LIVE_OIDC_ALLOWED_CLIENTS. That client id answers the device code flow (Microsoft's device code endpoint gave a user code for it on 2026-11-30), and preauthorized it needs no consent: "Pre-authorize only those client applications you trust since your users won't have the opportunity to decline consent" (Microsoft: expose a web API). Anyone anywhere could then start a device code sign-in for designIQ's scope with it, have a person enter the code, and get a designIQ token in that person's name, which the allowlist takes. If VS Code is preauthorized all the same, a Conditional Access policy must block the device code flow for designIQ (Conditions > Authentication flows > Device code flow, grant Block access: Microsoft: block authentication flows), and the pentest tries a device code sign-in with VS Code's id against it.
  • Clients without a registered client id (Client ID Metadata Documents): Entra ID serves them at a versioned authority, https://login.microsoftonline.com/<tenant id>/oauth21/2026-08, in preview: "This preview is provided without a service-level agreement and isn't recommended for production workloads" (Microsoft: client ID metadata documents). Not for the pilot. Do not point LIVE_OIDC_ISSUER at it: the tokens it issues still name the /v2.0 issuer (Microsoft: secure an MCP server with Entra ID), so the Live Host would refuse every token, the browser's too (auth/wrong-issuer).

Without Keycloak in between, nothing of designIQ's outlives an AI client's access token: it works until that token expires (60 to 90 minutes), then the client needs a refresh at Entra ID. That Entra ID refuses the refresh of a person you disabled, and how soon, only your tenant shows.

AI clients (MCP): Keycloak brokering Entra ID ​

The alternative, for a Live Host whose host name is on no domain verified in your tenant, or for clients that need dynamic client registration or metadata that names its PKCE methods. AI clients sign in at Keycloak, and Keycloak signs the person in at Entra ID: Entra ID stays the directory that decides who may sign in, and Keycloak is the authorization server MCP clients use (RFC 8414 metadata, PKCE, a pre-registered public client). The browser sign-in goes the same way, so the Live Host has one issuer, Keycloak's. Start from the shipped realm (idp-quickstart.md) on a Keycloak you run in production, then:

  1. In Entra ID, an app registration for Keycloak. As steps 1, 3 and 8 above, with the Web redirect URI https://<keycloak>/realms/designiq/broker/entra/endpoint. It needs no exposed API: Keycloak verifies Entra ID's ID token, which is issued for this registration's client id. Emit the directory extensions of step 7 in the ID token (optionalClaims.idToken): gitlabUsername, on a host with a GitHub App beside the GitLab githubLogin too, and the email optional claim if your people have mailboxes.

  2. In Keycloak, the identity provider. Identity providers > OpenID Connect v1.0: alias entra; discovery endpoint https://login.microsoftonline.com/<tenant id>/v2.0/.well-known/openid-configuration; client authentication Client secret sent as post with the registration's client id and secret; PKCE S256; scopes openid profile email; sync mode Force; Trust email on. Turn Disable user info on: Entra ID's userinfo endpoint is Microsoft Graph's and carries none of the extension claims, the ID token does.

  3. The login claims. The shipped realm declares the user attributes gitlab_username and github_login, which only administrators edit, and its clients designiq-web and designiq-mcp put each into the access token under its own name (a realm imported from an older realm-designiq.json gets gitlab_username by hand: Keep what you set up). On the identity provider, add a mapper Attribute Importer: claim extn\.gitlabUsername (the backslash keeps the dot inside the claim name), user attribute gitlab_username, sync mode Force, so a change in the directory reaches Keycloak at the next sign-in. On a host with a GitHub App beside the GitLab, add a second one: claim extn\.githubLogin, user attribute github_login, sync mode Force. Without it a person from Entra ID has no GitHub login (the realm's GitHub sign-in is off, and nobody but an administrator sets the attribute), and the Live Host refuses every sign-in.

  4. Entra ID the only way in. In Authentication, open the browser flow and the settings of its Identity Provider Redirector step, and set the default provider to entra. Keycloak then goes to Entra ID at once; people never see Keycloak's password form.

  5. The Live Host. The Keycloak values of idp-quickstart.md (issuer, JWKS, LIVE_OIDC_AUDIENCE, LIVE_OIDC_CLIENT_ID) and the login claims of step 3:

    • a host with a GitLab only: LIVE_OIDC_LOGIN_CLAIM=gitlab_username;
    • a host with a GitHub App beside the GitLab: LIVE_OIDC_LOGIN_CLAIM=github_login (its default) and LIVE_OIDC_GITLAB_LOGIN_CLAIM=gitlab_username. Each person then has two identities, and a token without github_login is refused; name gitlab_username for both only where everyone's logins are the same on both hosts (a host with both).

    Then LIVE_MCP_CLIENT_ID=designiq-mcp and LIVE_MCP_CALLBACK_PORT=8765, so the Connect an AI client dialog hands people the working command:

    bash
    claude mcp add --transport http designiq https://<host>/mcp --client-id designiq-mcp --callback-port 8765

    The first connection opens the browser: Keycloak, Entra ID's sign-in (with your conditional access and MFA), back to the client. Register the callbacks of other clients on designiq-mcp (the clients). LIVE_OIDC_ALLOWED_CLIENTS=designiq-web,designiq-mcp keeps the tokens of the realm's other clients out.

Keycloak's own sessions and tokens now sit between Entra ID and designIQ: a person disabled in Entra ID cannot sign in again, but keeps a running Keycloak session (12 hours in the shipped realm) and an AI client keeps its refresh token until Keycloak's session ends. Shorten them in the realm if that is too long, and remove the person's Keycloak user when they leave.

What was proven, and what only a real tenant can prove ​

No Entra ID tenant of ours took part. What each statement on this page rests on:

Microsoft's live sign-in endpoint (login.microsoftonline.com, 2026-11-30): the discovery documents and keys as described above, and the authorize endpoint's rules for AI clients, probed with requests that stop at the sign-in page, with Microsoft's own applications (Azure Resource Manager) standing in for designIQ's: a request without a scope refused (AADSTS900144); a resource beside the scope taken when it is an identifier URI of the scope's application (with or without a trailing slash, another identifier URI of the same application, its client id) and refused with AADSTS9010010 when it is another URL, a path under an identifier URI or another application's; a localhost redirect URI on any port; the device code endpoint giving a user code for VS Code's client id. That an identifier URI with a path, such as https://<host>/mcp, behaves the same for your own app registration is the reading of these probes, not a probe.

A stand-in for Entra ID (apps/live-host/test/entra-idp.ts, run by test/entra-id.test.ts in every test run), which follows those rules and Microsoft's documentation: the Graph token of the OpenID Connect scopes refused at the sign-in and as a bearer, with what to change; the app scope's v2 token accepted, the login from extn.gitlabUsername, no email needed; a v1 token refused on a v2 configuration and accepted on the v1 one (its issuer, its App ID URI); the audience and the missing claim named; the boot refusals of a scope-less and a v1 configuration; the real server signing a person in with LIVE_OIDC_SCOPE, LIVE_OIDC_AUDIENCE and the claim set, and with an empty LIVE_OIDC_LOGIN_CLAIM and LIVE_OIDC_AUDIENCE taken as unset. For AI clients: the authorize rules above, a scope under an api:// name beside the https resource refused (AADSTS9010010) until the app registration has both identifier URIs, and the token endpoint checking the resource again at the code and at a refresh; then the real server with this page's values, the MCP client library (@modelcontextprotocol/client 2.4.0) signing in with the AI clients' app registration, listing the tools and renewing its token with a refresh; the values this page had before (no LIVE_MCP_SCOPES) answered with the startup report's warning and Entra ID's AADSTS900144 page; without the https identifier URI AADSTS500011; a token of another application refused by LIVE_OIDC_ALLOWED_CLIENTS. Claude Code 2.1.333 (an isolated configuration, a script as its browser) signed in against the same stand-in and a Live Host of this release with this page's values (claude mcp add ... --client-id, claude mcp login), showed designiq connected and listed its 30 tools in a session; with the values the page had before, the browser showed AADSTS900144 and Claude Code Needs authentication.

A mock of Entra ID written for the research before this release (the same rules, an independent implementation): Claude Code 2.1.332 and the MCP client library signed in through it to a Live Host 5.17.0 with the identifier URI, LIVE_MCP_SCOPES and LIVE_MCP_CLIENT_ID as above (the allowlist did not exist yet) and listed the tools, the library refreshed; with the values the page had then they failed with AADSTS900144, with only an api:// scope with AADSTS9010010; pointing LIVE_OIDC_ISSUER at the versioned authority made every token auth/wrong-issuer.

For real, on 2026-11-30, on Keycloak 26.6.3 with GitLab CE 19.6.2: a second Keycloak realm played Entra ID (a confidential client for the broker, the directory extension as extn.gitlabUsername), designIQ's realm brokered it as above, and a Live Host of this release signed a person in through both in sandboxed Chromium and listed the GitLab project they are a Developer of. Through the same broker, the official MCP client library and a real Claude Code (2.1.332, the dialog's command, claude mcp login) signed in with the pre-registered client and listed that repository; a person without the claim was refused with the token's claims named.

The first sign-in in your tenant must confirm what neither the probes nor the stand-in can: that Entra ID's token endpoint issues the token for the code with resource=https://<host>/mcp and renews it with a refresh that sends the resource again (the stand-in and the mock assume it checks the resource as the authorize endpoint does; Microsoft's token endpoint refuses a made-up code before it looks at the resource, so it could not be probed); that your tenant's identifier URI policy takes https://<host>/mcp; consent and assignment for the AI clients' app; that it signs in with Allow public client flows at No and refuses a device code sign-in; and that tokens the AI clients' app asks for carry extn.gitlabUsername (designIQ's optional claim). An hour in any tenant with a verified domain settles the first before the pilot: an app registration with such an identifier URI, a public client with consent for its scope, a manual sign-in with PKCE, the token request with the resource, then a refresh.

Only a real tenant shows besides: the claims of Entra ID's real tokens (the optional claims, the directory extension's extn. name, the v1 path, the client id in lower case in azp), the claims mapping route for an Entra Connect extension (the mapped claim in the token, AADSTS50146 and AADSTS501461), consent and assignment prompts, the AADSTS codes of an expired secret, Keycloak's handling of Entra ID's real ID token, conditional access and MFA in both flows, RP-initiated sign-out at Entra ID, the lifetime of refresh tokens and their end when a person is disabled, and the clients marked unverified above. Try the sign-in with one test person before the pilot's people.