API reference

OAuth providers

Sign people in with an identity provider such as Google, GitHub or Microsoft.

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#

GET/v1/auth/:app_id/oauth/authorizeNone

Redirects (302) to the provider's authorization page. Open it in the browser, not with fetch. Scute uses PKCE with the provider.

providerstringrequired
One of the supported provider slugs.
URL
https://api.scute.io/v1/auth/app_xxx/oauth/authorize?provider=google
StatusBodyWhen
422{"errors": "Provider not allowed"}provider is not a supported slug.
422error_code provider_not_enabledThe provider is not turned on for the app.

Callback#

GET/v1/auth/:app_id/oauth/callbackNone

The 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 queryMeaning
sct_oauth=<token>&sct_sk=trueSign-in accepted. Exchange sct_oauth with Authenticate a magic link.
sct_oauth_pending=email_verificationThe 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#

cURLbash
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.