Social sign-in
Sign users in with third-party providers.
Before you start
Enabled per environment
id0n enables sign-in methods and features for each Legation environment. Ask id0n to turn on what your application needs.
Request fields
Social sign-in redirects the user to a provider, then back to your app.
| Field | Description |
|---|---|
provider | Provider ID, for example google or github. |
callbackURL | Where to send the user after sign-in. |
newUserCallbackURL | Where to send users who just signed up. |
errorCallbackURL | Where to send the user if sign-in fails. |
disableRedirect | Return the provider URL instead of redirecting. |
idToken | Sign in with a provider ID token instead of a redirect. Supported providers only; see below. |
Providers include Apple, Discord, GitHub, GitLab, Google, LinkedIn, Microsoft and Slack, among others. Ask id0n which providers are enabled for your environment and how provider credentials are configured.
Sign in with an ID token
Some providers let your app sign the user in with an ID token it already has, for example from a native sign-in SDK, instead of a redirect. Legation verifies the token before it creates a session. Providers with ID-token verification are Apple, Amazon Cognito, Facebook, Google, LINE and Microsoft Entra ID. Other providers return ID_TOKEN_NOT_SUPPORTED. Whether ID-token sign-in is enabled for a provider is set for your environment.
Errors
| Error | Meaning |
|---|---|
PROVIDER_NOT_FOUND | The provider is not enabled. |
ID_TOKEN_NOT_SUPPORTED | The provider does not support ID-token sign-in. |
FAILED_TO_GET_USER_INFO | The provider did not return the user's details. |
USER_EMAIL_NOT_FOUND | The provider did not return an email. |