Social login allows users to authenticate with their existing accounts from providers like Google, Apple, Microsoft, GitHub, Okta, and Facebook.Documentation Index
Fetch the complete documentation index at: https://docs.prelude.so/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you start, make sure you have:- A Prelude account with access to the Session API
- An Application ID (
appID) — see Applications - Your Management API key for backend calls
- OAuth credentials from the provider you want to configure (client ID, client secret, etc.)
Supported providers
| Provider | Identifier |
|---|---|
google | |
| Apple | apple |
| Microsoft | microsoft |
| GitHub | github |
| Okta | okta |
facebook |
Configuration options
All providers share the following options:| Field | Type | Description |
|---|---|---|
client_id | string | OAuth client ID from the provider. |
client_secret | string | OAuth client secret from the provider. |
enabled | boolean | Set to true to enable the provider. |
options.use_email_as_identifier | boolean | When true, creates an email identifier for new OAuth users. Only applied when the email is verified — either by the provider, or via the verify_email OTP flow. |
options.allow_email_account_merge | boolean | When true, allows merging accounts that share the same verified email address. |
options.verify_email | boolean | When true, falls back to an email OTP challenge when the provider returns an unverified email. See Verify email via OTP below. Requires use_email_as_identifier=true and at least one email OTP login config; both are enforced at write time. |
Email verification trust model
use_email_as_identifier and allow_email_account_merge both depend on whether the provider vouches that the email belongs to the signed-in user. Session uses provider-specific signals:
| Provider | Verification signal | Notes |
|---|---|---|
email_verified claim in ID token | Verified by default. | |
| Apple | email_verified claim in ID token | Verified by default. |
| Microsoft | xms_edov optional claim | Not verified by default. Customers must enable the xms_edov optional claim in Azure Token Configuration — otherwise the email is treated as unverified and auto-merge is disabled. See the Microsoft guide for setup steps and background on the nOAuth vulnerability this prevents. |
| GitHub | Primary + verified email from the /user/emails API | Verified by default. |
| Okta | email_verified claim in ID token | Depends on your Okta tenant configuration. |
| Returned email from the Graph API | Verified by default. |
allow_email_account_merge is enabled and an unverified email collides with an existing Session user, the flow is rejected with an email_in_use error instead of silently linking the accounts.
Verify email via OTP
Enableverify_email on a provider when you want users to keep signing in even if the IdP returns the email as unverified. Instead of rejecting the flow or creating an unlinked account, Session sends an email OTP to the address surfaced by the IdP and links the OAuth identifier only after the user proves ownership.
The flow:
- The user signs in with the OAuth provider.
- The IdP returns an email but does not vouch for it (e.g. Microsoft without
xms_edov, or a custom Okta tenant). - Session redirects back to your app with
challenge_token=…&status=otp_requiredinstead of finalizing the login. - The Web SDK’s
finalizeOAuthLoginreturns{ status: "otp_required", challengeId, email }so your app can route to its OTP screen and callcheckOTPwith the code the user entered. - On a successful OTP, Session attaches the OAuth identifier to (or creates) the user that owns the email and finalizes the login automatically.
use_email_as_identifiermust betrue. Verifying an email that will never be persisted as an identifier serves no purpose.- The application must have at least one email OTP login config. Removing the last email OTP login config while any provider still has
verify_email=trueis rejected.
verify_email is true but use_email_as_identifier is later flipped off, the OTP step is skipped at runtime and the account is created with only the OAuth identifier — the existing config keeps loading instead of breaking, but the OAuth-link flow is effectively disabled until both flags are aligned.
When the email already belongs to another account and allow_email_account_merge is false, Session rejects with email_in_use before sending the OTP so the user does not get sent through a screen for a flow that would dead-end.
Provider guides
Configure Google OAuth for your application.
Apple
Configure Apple OAuth for your application.
Microsoft
Configure Microsoft OAuth for your application.
GitHub
Configure GitHub OAuth for your application.
Okta
Configure Okta OAuth for your application.
Configure Facebook OAuth for your application.