Supported providers
| Provider | provider value |
|---|---|
google | |
facebook | |
| Apple | apple |
| GitHub | github |
twitter |
422 validation error.
Endpoint
throttle:api
Request
OAuth provider name. Must be one of:
google, facebook, apple, github, twitter.OAuth access token issued by the provider. Maximum 4096 characters (enforced to prevent memory-exhaustion attacks).
The user’s unique ID within the provider’s system (e.g. Google subject ID). Maximum 255 characters.
Email address from the OAuth profile. Validated with RFC and DNS checks.
Display name from the OAuth profile. If omitted, the local part of the email is used.
URL to the user’s profile image. Maximum 2048 characters. Must be a valid URL.
Response — authenticated user
When the provider identity matches an existing account or a new account is created:Sanctum token named
social-api-token. Use it as a Bearer token in subsequent requests.Either
/dashboard for existing users or /onboarding if the account requires additional setup.Response — onboarding required
If the social identity is new and the user needs to complete a profile:redirect_to value is set to /onboarding when AuthStatus::REQUIRES_ONBOARDING is returned by the domain handler.
How it works
TheAuthController::socialLogin method constructs a LoginViaSocialProviderCommand from the validated request data and dispatches it to the LoginViaSocialProviderHandler:
provider_id or email, or creates a new user record if neither matches.
Idempotency
TheIdempotency-Key header is accepted but not strictly required. If omitted, the handler generates a UUID internally. Providing the key prevents duplicate account creation if the client retries a timed-out request.
Error responses
| Scenario | HTTP status | Field |
|---|---|---|
| Invalid provider | 422 | provider |
| Token exceeds 4096 characters | 422 | token |
| Missing or invalid email | 422 | email |
| Tenant context cannot be resolved | 422 | tenant |