new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

Better Auth · Plugins · all subjects

sso/client-methods

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Sign in with SSO using email domain matching

Call `authClient.signIn.sso()` with email parameter to sign in using email with domain matching. Example: `authClient.signIn.sso({ email: 'user@example.com', callbackURL: '/dashboard' })`.

Sign in with SSO using domain

Call `authClient.signIn.sso()` with domain parameter to sign in by domain. Example: `authClient.signIn.sso({ domain: 'example.com', callbackURL: '/dashboard' })`.

Sign in with SSO using organization slug

Call `authClient.signIn.sso()` with organizationSlug parameter to sign in when a provider is associated with an organization. Example: `authClient.signIn.sso({ organizationSlug: 'example-org', callbackURL: '/dashboard' })`.

Sign in with SSO using provider ID

Call `authClient.signIn.sso()` with providerId parameter to sign in using a specific provider's ID. Example: `authClient.signIn.sso({ providerId: 'example-provider-id', callbackURL: '/dashboard' })`.

Sign in with SSO using login hint

Call `authClient.signIn.sso()` with loginHint parameter to prefill or direct the identity provider. Example: `authClient.signIn.sso({ providerId: 'example-provider-id', loginHint: 'user@example.com', callbackURL: '/dashboard' })`.

signInSSO endpoint parameters

The POST `/sign-in/sso` endpoint accepts these parameters: email (string, optional, used to identify issuer), organizationSlug (string, optional), providerId (string, optional), domain (string, optional), callbackURL (string, required, URL to redirect to after login), errorCallbackURL (string, optional), newUserCallbackURL (string, optional, redirect if user is new), scopes (string array, optional), loginHint (string, optional, sent to identity provider), requestSignUp (boolean, optional, explicitly request sign-up). If email is provided and loginHint is not specified, email is automatically sent as login_hint to OIDC providers. SAML flows do not support login_hint.

Give your agent this brain