An OAuth sign-in is a browser redirect. Scute sends the person to the provider, takes the callback, and redirects back to your app's login URL with a one-time token that you exchange for a session.
The provider must be turned on for the app in the dashboard under App > Authentication, with its client ID and secret.
Supported providers: google, facebook, github, discord, twitter, apple, microsoft, linkedin, gitlab, bitbucket.
Start an OAuth sign-in#
/v1/auth/:app_id/oauth/authorizeNoneRedirects (302) to the provider's authorization page. Open it in the browser, not with fetch. Scute uses PKCE with the provider.
https://api.scute.io/v1/auth/app_xxx/oauth/authorize?provider=google| Status | Body | When |
|---|---|---|
| 422 | {"errors": "Provider not allowed"} | provider is not a supported slug. |
| 422 | error_code provider_not_enabled | The provider is not turned on for the app. |
Callback#
/v1/auth/:app_id/oauth/callbackNoneThe provider redirects here. Register https://api.scute.io/v1/auth/<app UUID>/oauth/callback as the redirect URI in the provider's console (the app's UUID, not its app_xxx public ID). Scute reads the person's email from the provider, runs the sign-in checks and redirects to the app's origin plus login URL:
| Redirect query | Meaning |
|---|---|
| sct_oauth=<token>&sct_sk=true | Sign-in accepted. Exchange sct_oauth with Authenticate a magic link. |
| sct_oauth_pending=email_verification | The provider did not confirm the email is verified and an account with that email already exists. Scute emailed a sign-in link to the address instead. |
A provider that returns no valid email gets 400 invalid_identifier. Any other failure returns 500 with {"message": "OAuth authentication failed"}.
Finish the sign-in#
curl -X PATCH https://api.scute.io/v1/auth/$SCUTE_APP_ID/magic_links/authenticate \ -H "Content-Type: application/json" \ -d '{"token": "'"$SCT_OAUTH"'"}'Returns a token set, or the next sign-in step. Attack protection and the app's MFA settings apply to OAuth sign-ins at this call.
An OAuth sign-in is exempt from enforced SAML SSO on customer apps.