mlab docs

Single sign-on (OIDC)

Sign in through your identity provider with OpenID Connect - Microsoft Entra ID, Okta, Google, Keycloak - with accounts created at first sign-in.

Each organisation can sign in through its own identity provider with OpenID Connect. Users click Sign in with SSO on the sign-in page; their account is created the first time they sign in, if their email domain is allowed. Available on every tier.

Set it up

1. Register the platform at your identity provider

Create an OpenID Connect application (a "web application" with a client secret) and register this redirect URI:

<PUBLIC_URL>/api/v1/auth/sso/callback

PUBLIC_URL is the address your users reach the platform at, set in .env without a trailing slash. It defaults to http://localhost:8080, so set it on any real deployment:

.env
PUBLIC_URL=https://tprm.example.com

The platform asks for the openid email profile scopes and uses the authorization code flow with PKCE.

ProviderIssuer URL
Microsoft Entra IDhttps://login.microsoftonline.com/<tenant-id>/v2.0
Oktahttps://<your-domain>.okta.com
Google Workspacehttps://accounts.google.com
Keycloakhttps://<host>/realms/<realm>
mlab.shhttps://mlab.sh

2. Configure the organisation

As an administrator, open Organization > General > Single sign-on (OpenID Connect) (/orga/team/settings) and fill in:

FieldWhat to enter
Offer "Sign in with SSO"Turns the button on for this organisation.
Issuer URLThe issuer from the table above. Its discovery document, <issuer>/.well-known/openid-configuration, must be reachable from the server.
Allowed email domainsbank.com, bank-group.eu: who may sign in, and get an account at first sign-in. A domain can belong to one organisation per instance.
Client ID / Client secretFrom the application you registered. The secret is never shown again once saved; leave the field empty to keep it.
Redirect URIShown read-only: copy it into your identity provider.

Saving checks the issuer at once: an unreachable provider, or an issuer that is not https, is refused.

SSO only

SSO only turns off, for everyone but local administrators:

  • password sign-in,
  • password reset links,
  • invitations: the Invite Member button gives way to "Accounts are created at first sign-in with SSO".

Local administrators keep their password. They are the way back in if the identity provider is down or misconfigured, so SSO only cannot be turned on while the organisation has no local administrator with a password.

How sign-in works

  1. The user enters their work email and clicks Sign in with SSO. The email domain picks the organisation; with a single organisation offering SSO on the instance, the email can be left empty.
  2. The identity provider authenticates them and sends them back with a one-time code, valid for 10 minutes.
  3. The platform exchanges the code (client secret and PKCE), reads the user's profile from the provider, and checks that:
    • the email is verified at the provider, when it says so,
    • its domain is allowed for the organisation,
    • an existing account with that email belongs to the same organisation.
  4. On the first sign-in, a member account is created, without a password, with the first and last name from the provider. The user limit of the license applies.

Good to know

  • Roles. Accounts created by SSO are members. Roles are not mapped from the identity provider's groups yet.
  • Leavers. Someone removed at the identity provider can no longer sign in. A session they already have open stays valid until they sign out.
  • Existing accounts with an allowed email can use SSO too: the account is matched by email.
  • SAML is not supported. Most providers offer OpenID Connect next to SAML; ADFS 2016 and later included.

Troubleshooting

Message on the sign-in pageCause
No single sign-on is set up for this email domain.The domain is not in any organisation's allowed domains, or SSO is off.
The identity provider cannot be reached.The server cannot fetch <issuer>/.well-known/openid-configuration: check outbound HTTPS and the issuer URL.
The identity provider refused the sign-in.The provider returned an error: often a redirect URI that does not match <PUBLIC_URL>/api/v1/auth/sso/callback exactly.
Sign-in with the identity provider failed.The code exchange failed: usually a wrong client secret. The app logs give the provider's answer.
This sign-in link has expired.More than 10 minutes passed, or the app restarted during the sign-in. Try again.
Your organization has reached its user limit.The license allows no more users (3 on Free).

On this page