Set up Microsoft Entra single sign-on
This guide gets people signing in to Weavestream with their Microsoft work accounts. You do everything in two places: the Microsoft Entra admin center and Admin → Settings → Single sign-on in Weavestream. No server access or environment variables are needed.
You need to be a Weavestream super admin (the Single sign-on settings are SUPER_ADMIN only) and an Entra administrator who can register applications.
If your deployment sets
SSO_OIDC_ISSUERin its environment, the settings tab is read-only and says "Managed by environment variables". The environment wins. See Environment variables.
Throughout, replace the placeholders with your own values: <tenant-id>, <client-id>, <secret-value> and <weavestream-api-url>.
Before you start
- In Weavestream, open Admin → Settings → Single sign-on.
- Tick Enable single sign-on. The other fields appear only while it is ticked. Do not save yet.
- Copy the Callback URL (the Copy button). It looks like
<weavestream-api-url>/v1/auth/sso/callback. You will paste it into Entra in step 2.
If the callback URL looks wrong (for example localhost), the deployment's API_URL is not set to the public address. Fix that first, because Entra must send people back to a URL they can reach.
1. Register the application (single tenant)
- In the Entra admin center, go to Entra ID → App registrations → New registration.
- Name it, for example
Weavestream. - Under Supported account types choose Accounts in this organizational directory only (Single tenant). Do not pick a multi-tenant option: Weavestream refuses
common,organizationsandconsumersissuers, because anyone's email address can be claimed in another tenant. - Leave the redirect URI empty for now and select Register.
- On the Overview page note the Application (client) ID (
<client-id>) and the Directory (tenant) ID (<tenant-id>).
2. Add the redirect URI
- Open Authentication → Add a platform → Web.
- Paste the Callback URL you copied from Weavestream as the Redirect URI.
- Leave implicit grant and hybrid flow options unticked. Weavestream uses the authorization code flow with PKCE.
- Select Configure.
The URL must match exactly, including https and no trailing slash differences. A mismatch shows up at Microsoft's sign-in page as an error naming the redirect URI.
3. Create a client secret
- Open Certificates & secrets → Client secrets → New client secret.
- Choose a description and an expiry.
- Copy the secret Value (
<secret-value>) straight away. Entra shows it only once. Do not copy the Secret ID. - Note the expiry date somewhere you will see it. When the secret expires, nobody can sign in with SSO until you replace it (see
Troubleshooting ).
4. Add the optional claims (recommended)
Open Token configuration → Add optional claim → ID and add:
When Entra offers to add the Microsoft Graph email permission, accept. These claims are optional, and without them people can still sign in once their account is linked.
5. Assign people to the application
By default every user in your directory can start a sign-in. To limit it:
- Go to Entra ID → Enterprise applications, open the application, then Properties.
- Set Assignment required? to Yes and save.
- Open Users and groups → Add user/group and assign the people or groups who should use Weavestream.
Someone who is not assigned is turned back at sign-in with "not allowed".
6. Enter the values in Weavestream
In Admin → Settings → Single sign-on:
- Tick Enable single sign-on if it is not ticked, and leave the provider type on Microsoft Entra ID.
- Paste the Directory (tenant) ID into Directory (tenant) ID. The tab shows the issuer URL it builds from it (
https://login.microsoftonline.com/<tenant-id>/v2.0) and also accepts sign-ins only from this tenant. - Paste the Application (client) ID into Client ID.
- Paste
<secret-value>into Client secret. - Set Provider name to what people should see, for example
Microsoft. The button will read "Sign in with Microsoft". - Leave Scopes as it is.
- Choose the account rules (you can change them later):
- Link accounts by email: turn on if your people already have Weavestream accounts and you added the
emailandxms_edovclaims. Super admins and accounts with platform capabilities are never linked this way (section 8). - Create accounts automatically: turn on only if anyone assigned in Entra should get an account. New accounts have no access until you grant it.
- Trust the provider's multi-factor sign-in: turn on if Entra enforces MFA for these people (for example Conditional Access). Weavestream then skips its own two-factor code for those sessions. If Entra does not report MFA, Weavestream still asks for its own code.
- Link accounts by email: turn on if your people already have Weavestream accounts and you added the
- Leave Allow password sign-in on for now.
- Select Save single sign-on settings. Confirm with your usual two-factor code or password when asked.
The tab refuses to save an incomplete or unsafe setup and tells you which field to fix.
- If you change the Directory (tenant) ID or the Client ID, enter the client secret again. The saved secret belongs to the old application and is removed.
- If another administrator saved the tab after you opened it, your save is refused. Reload the page and make your change again.
- A sign-in that is in progress when the issuer, client ID, tenant or scopes change is ended with "expired". The person signs in again.
7. Test the connection
Select Test connection. It checks, from the Weavestream server, that:
- the issuer answers with a discovery document,
- the document names exactly the issuer you entered,
- the sign-in and token addresses use https,
- the provider's signing keys can be fetched, and
- this deployment can finish a sign-in (
API_URLis under the same origin asAPP_URL).
It does not sign anyone in, and it cannot check that the callback URL is registered in Entra. That is what step 2 was for. The test only reaches public internet addresses.
8. Link your own admin account
Super admins and accounts with platform capabilities are never linked by email, so link yours yourself. This is also what makes it safe to turn off password sign-in later.
- Sign out, then on the login page choose Sign in with Microsoft to confirm the button appears and Microsoft's page loads. (If you are not yet linked you will see "no account". That is expected.)
- Sign in the usual way (password and two-factor code), then click your avatar and open Profile → Security → Single sign-on.
- Choose Link Microsoft account, confirm when asked, and pick your work account at Microsoft.
- You return to Profile with a message that the account is linked.
- Sign out and use Sign in with Microsoft again. You should land in Weavestream.
Other accounts with platform capabilities must link themselves the same way, while they can still sign in with a password. Everyone else is linked automatically on first sign-in (if you enabled Link accounts by email), or can link themselves from the same place.
If you are asked to set up or enter a two-factor code right after a Microsoft sign-in, Entra did not tell Weavestream that MFA happened. That is normal when Trust the provider's multi-factor sign-in is off, or when Entra does not send the amr claim. Complete the Weavestream two-factor step as usual.
Entra sends no amr claim. Entra v2 ID tokens leave out amr unless you request it, so Weavestream cannot see that MFA happened even when it did. Add amr as an optional ID token claim (step 4). Sign-ins that complete MFA then carry mfa and skip the Weavestream code when Trust the provider's multi-factor sign-in is on. A sign-in without MFA (for example one that Conditional Access does not cover) still gets the Weavestream code.
9. Optionally turn off password sign-in
Once at least one super admin has signed in and linked through SSO, and every account with platform capabilities has linked itself (step 8):
- Return to Admin → Settings → Single sign-on.
- Untick Allow password sign-in and save.
Everyone except super admins must now use Microsoft. Passwords of non-super-admins stop working immediately, including sessions already open. An account with platform capabilities that is not linked then has no way in until an administrator turns password sign-in on again.
Weavestream refuses to save this (a "conflict" message) until an active super admin is linked at this provider, so you cannot lock everyone out by accident.
Break-glass
Super admins keep password sign-in on purpose, so that a broken Entra setup, an expired client secret or an Entra outage cannot lock you out. To keep that safe:
- Keep at least one super admin with a known password and working two-factor code or backup codes, stored somewhere safe.
- To recover, sign in with that account using a password, then fix or replace the SSO settings. You can also turn single sign-on off completely from the same tab.
- If nobody can sign in at all, use the super admin recovery CLI.
Troubleshooting
Sign-in problems send the browser back to the login page with a short message. Weavestream deliberately keeps these generic. The detail is in the audit log (auth.sso.login.failure, with a fixed reason code, never a token) and the API log.
The sign-in button is missing from the login page when SSO is off, incomplete, or when the saved client secret cannot be read (for example after a key change). Open the tab and save the secret again. While the secret cannot be read, a password sign-in restriction you saved stays in force, so only super admins can sign in until the secret is replaced.