What you need from the identity provider
Register Ragen as an application (Entra ID calls this an app registration, Google calls it an OAuth client) with:- Redirect URI:
<APP_URL>/api/auth/callback/oidc, for examplehttps://ragen.example.com/api/auth/callback/oidc - Scopes:
openid,email,profile - A client ID and a client secret
Configuration
Set these on the web app:- Microsoft Entra ID
- Google Workspace
In the Microsoft Entra admin center, go to App registrations → New registration:Use your tenant id, not
- Supported account types: Accounts in this organizational directory only (single tenant).
- Redirect URI: platform Web (not Single-page application), value
<APP_URL>/api/auth/callback/oidc. Entra acceptshttponly forlocalhost. Add one URI per environment you sign in to. - From Overview, copy the Application (client) ID and the Directory (tenant) ID.
- Under Certificates & secrets → New client secret, copy the Value column. The Secret ID next to it is a GUID that looks like a client ID, and it does not work as either one. The value is shown only once.
- Under API permissions, add the delegated Microsoft Graph permissions
openid,emailandprofile. Each person consents on their first sign-in. To skip that prompt for everyone, grant admin consent.
email claim in the ID token, and Entra leaves it out when the account has no email address. For a work account, that address is usually the Email field (the mail attribute), which accounts with a Microsoft 365 mailbox have. For an account without one, fill in Email on the user’s properties. If the claim is still missing, add email as an optional ID token claim under Token configuration. Without the claim, Ragen has no address to check and refuses the sign-in.common or organizations. A multi-tenant issuer vouches for accounts outside your company. Set OIDC_TRUST_EMAIL=true only when your tenant owns every domain in OIDC_ALLOWED_DOMAINS.Who gets in
- Domain. Ragen refuses any address outside
OIDC_ALLOWED_DOMAINSbefore it creates or links an account, and sends the person back to sign-in with an error. The match is exact:sub.example.comis notexample.com. - Existing accounts. If someone already has a password account with the same address, the company sign-in links to it only when the issuer reports the address as verified, and only for an allowed domain. An issuer that does not own your domain cannot take over a local account by claiming its address.
- Tokens. Ragen verifies the ID token against the issuer’s published keys, and uses PKCE.
Where new users land
WithOIDC_JOIN_ORGANIZATION set, a person signing in for the first time becomes a member of that organization, even when registration is closed. The identity provider and the allowed domains decide who that is, and an administrator promotes members as usual. This only applies when the address is verified, either by the issuer or by OIDC_TRUST_EMAIL. If the organization you name does not exist, the sign-up is refused.
Without OIDC_JOIN_ORGANIZATION, company sign-in works like the other sign-up methods. It needs registration to be open, or an invitation, and each new user gets an organization of their own.
When something goes wrong
When sign-in is refused
A refused company sign-in sends the person back to the sign-in page, with a message under the Sign in with … button. Ragen creates no account and no membership on a refusal. The address bar ends in?error=<code>. Ask the person for that code or the message, then look it up here.
The messages are translated into every language the interface supports.
SAML, SCIM directory sync, and MFA are not built yet. See the roadmap.