Skip to main content

OIDC with Microsoft Entra ID

This page sets up OIDC sign-in with Microsoft Entra ID: people sign in to ProjectAchilles with their organization account, under the tenant's own MFA and Conditional Access, and their console role comes from an app role assigned in Entra ID. It was validated end to end on a real tenant and a real server install.

Not the same as Entra ID through Clerk

Entra ID SSO connects Entra ID to Clerk, and roles stay in ProjectAchilles. This page connects the console to Entra ID directly, with no Clerk, and roles come from Entra ID.

You need:

  • the console's address, for example https://achilles.example.com. The redirect URI is that address plus /api/auth/oidc/callback: https://achilles.example.com/api/auth/oidc/callback;
  • an Entra account that can register applications and grant admin consent for the tenant.

1. Register the application​

In the Microsoft Entra admin center, open App registrations and select New registration.

  • Name: what people see on Microsoft's pages, for example ProjectAchilles.
  • Supported account types: accounts in this organizational directory only (single tenant).
  • Redirect URI: platform Web, and the redirect URI above.

Select Register. On the application's Overview, note the Application (client) ID (<client-id>) and the Directory (tenant) ID (<tenant-id>).

The redirect URI then appears under the application's Authentication page, platform Web:

The application&#39;s Authentication page in the Microsoft Entra admin center: one Web redirect URI, https://achilles.example.com/api/auth/oidc/callback

2. Create a client secret​

Open Certificates & secrets and add a New client secret.

Certificates &amp; secrets, Client secrets tab: one client secret with its description, expiry date, Value (shown masked after creation) and Secret ID

Copy the Value, once, straight into the config

Entra ID shows a secret's Value only once, right after you create it. Copy the Value, not the Secret ID next to it (the ID is not the secret; using it fails at the first sign-in with AADSTS7000215). Put it straight into the installer or deploy.config.env; never paste it into chat, a ticket or mail.

Note the secret's expiry date. Before it expires, create a new secret and give it to the console with achilles-installer auth set --rotate-secret. Once it has expired:

  • every re-check fails, and the backend logs [oidc] the provider refuses this console's client credentials (OIDC_CLIENT_ID / OIDC_CLIENT_SECRET);
  • people already signed in keep access for one more re-check interval, then every request answers 503, as when the provider is down;
  • new sign-ins show "Sign-in did not complete" (invalid_client in the log).

Open API permissions. Make sure these Microsoft Graph delegated permissions are listed, adding the missing ones: openid, profile, email, offline_access, User.Read. Then select Grant admin consent for <your organization>.

API permissions: the Microsoft Graph delegated permissions email, offline_access, openid, profile and User.Read, each with the status Granted for the organization

Without this step, a person's first sign-in can stop at Microsoft's "Approval required" page (depending on the tenant's user-consent policy), which asks them to request approval from an administrator.

Never remove offline_access to avoid the consent prompt

offline_access gives the console a refresh token, which is how it re-checks every signed-in person with Entra ID every OIDC_REVALIDATE_MINUTES. Without it, a person removed in Entra ID keeps console access until OIDC_SESSION_MAX_HOURS after their sign-in (12 hours by default). Grant admin consent instead.

4. Create the app roles​

Open App roles and create one role per console role. For each:

Display nameAllowed member typesValue
Achilles adminUsers/Groupsadmin
Achilles operatorUsers/Groupsoperator
Achilles analystUsers/Groupsanalyst
Achilles explorerUsers/Groupsexplorer

Enable each role. The Value is what reaches the console, in the ID token's roles claim. Values equal to the default role map (admin, operator, analyst, explorer) need no OIDC_ROLE_MAP. If your naming rules require other values (for example Achilles.Admin), set the role map to match, exactly and case for case:

OIDC_ROLE_MAP='admin=Achilles.Admin,operator=Achilles.Operator,analyst=Achilles.Analyst,explorer=Achilles.Explorer'

App roles: four roles allowed for Users/Groups, with the Values explorer, analyst, operator and admin. The display names can be anything; the Value is what the console reads

5. Require assignment and assign people​

Open Enterprise applications, then the application of the same name.

  1. Under Properties, set Assignment required? to Yes and save. Only people assigned to the application can then sign in to it; everyone else is stopped by Microsoft (AADSTS50105) and never reaches the console.

    The enterprise application&#39;s Properties page: Assignment required? set to Yes

  2. Under Users and groups, select Add user/group, choose the people and the role for them, and assign. Assigning a group, rather than single users, needs Entra ID P1 or P2.

Assign the admin role to at least one person before the install: the first console administrator is whoever holds admin here. There is no invitation step.

Things to know:

  • Directory roles give no console access. A Global Administrator or Security Administrator in Entra ID who is not assigned an app role cannot use the console.
  • After you grant admin consent, a Default Access row may appear in Users and groups next to your own assignment. It carries no role value and is harmless.
  • Removing a person's assignment ends their console access at their next request after the re-check interval: with "Assignment required" on, Entra ID refuses the console's refresh token for them, and they are marked inactive (see When access ends).

6. Email addresses​

The console shows each person's email from the ID token's email claim. An account without a mail address arrives with no email (the console does not use preferred_username for it). Give the account a mail address in Entra ID, or accept a blank email. The name comes from name, else preferred_username.

7. Configure the console​

The issuer is

https://login.microsoftonline.com/<tenant-id>/v2.0

with your tenant's Directory (tenant) ID. Never common, organizations or consumers: those accept accounts from any tenant, and the console refuses them.

In the installer wizard​

On a new install (Server Installer), the Login screen asks How do people sign in to the console? Choose Your identity provider (OIDC), then fill in:

  • Provider name (optional; the sign-in button's text), for example Microsoft Entra ID;
  • Issuer URL, as above;
  • Client ID: the Application (client) ID;
  • Client secret: the secret's Value;
  • Role map: keep the default if your app role Values are admin, operator, analyst, explorer;
  • Private CA file: leave empty. Entra ID uses a public certificate authority.

The screen shows the redirect URI to register at the provider and checks the issuer's discovery document before you continue. There is no Clerk step and no first-admin email. The final screen names the redirect URI and says who the first administrator is: whoever holds admin in the roles claim.

Unattended install​

Write a full deploy.config.env (see Server Installer: unattended install), with these lines in place of the three Clerk lines (CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY, ADMIN_EMAIL):

AUTH_MODE='oidc'
OIDC_ISSUER='https://login.microsoftonline.com/<tenant-id>/v2.0'
OIDC_CLIENT_ID='<client-id>'
OIDC_CLIENT_SECRET='<client-secret>'
OIDC_PROVIDER_NAME='Microsoft Entra ID'

then run:

sudo /opt/projectachilles/achilles-installer install --config /opt/projectachilles/deploy.config.env --yes

On an install that already signs in with OIDC, change settings with achilles-installer auth set (see Changing the settings). To switch an install that signs in with Clerk today, use achilles-installer auth set --mode oidc instead: see Switching an existing install.

Entra ID accepts the client secret both in the HTTP Basic header and in the request body, so the default OIDC_TOKEN_AUTH_METHOD=basic works.

8. Sign in​

Open the console. With no session, it starts sign-in at once; a person who is already signed in to Microsoft in that browser may see no prompt at all. Microsoft applies the tenant's MFA and Conditional Access as for any other application.

With OIDC_LOGOUT=provider, Log out also goes to Microsoft's sign-out page. When the browser holds several Microsoft accounts, Microsoft first asks which account to sign out of; after the choice the browser comes back to the console's "You are signed out" page.

Troubleshooting​

The console shows a fixed sentence; the details are in the backend's log (see OIDC sign-in: Troubleshooting for the command).

AADSTS50105: "Your administrator has configured the application … to block users unless they are specifically granted ('assigned') access"​

Microsoft's own page, shown before the console is reached. The person is not assigned to the application. Assign them a role in Enterprise applications → <application> → Users and groups. Nothing about this sign-in reaches the console's database.

"Your account has no role in this console." (/no-access)​

The person signed in at Microsoft, but the ID token's roles claim held no value in the role map. The backend logs [auth] Sign-in of subject "<subject>" refused (no-access): the claim "roles" holds no value mapped to an Achilles role. The console does not log or show the token itself, so check the three things the claim is made from:

  1. The assignment. In Enterprise applications → <application> → Users and groups, the person (or a group they are in) has a row with a role from step 4. A Default Access row carries no role.
  2. The Value. In App registrations → <application> → App roles, the role's Value is exactly a value of the role map, case included. An administrator sees the console's role map in Settings › Sign-in (under roles), or on the server with achilles-installer auth show.
  3. The claim name. OIDC_ROLE_CLAIM is roles (the default). Entra ID puts app roles in the roles claim.

Then have the person select Sign in again.

"Approval required" at the first sign-in​

The tenant's user-consent policy asks an administrator to approve the application. Grant admin consent (step 3). Do not remove offline_access to avoid it.

"Sign-in did not complete" and AADSTS7000215 in the log​

The backend logs [oidc] completing the sign-in failed (sign_in_failed): … error="invalid_client" … AADSTS7000215: Invalid client secret provided. The console has a wrong client secret, often the Secret ID instead of the Value. The installer cannot catch this, because checking the issuer needs no secret. Create a new secret if you no longer have the Value, then on the server:

sudo /opt/projectachilles/achilles-installer auth set --rotate-secret

It asks for the secret twice, shows nothing on screen, and restarts the console.

A provider that wants the secret in the request body​

Entra ID does not need this. Some providers accept the client secret only in the request body. The wizard notices that from the discovery document and sets OIDC_TOKEN_AUTH_METHOD=post itself; achilles-installer auth set stops with "This provider wants the client secret in the request body. Use --token-auth-method post." Run it again with --token-auth-method post.