Get started

Authentication methods

The ways a person signs in to a Scute app, the checks every sign-in passes and what comes back when a step is still owed.

Each app turns methods on and off in the dashboard (the app's Authentication page). The browser SDK is @scute/js-core. All endpoints below are under https://api.scute.io/v1/auth/:app_id.

signInOrUp#

signInOrUp(identifier, options?) takes an email or phone number, checks whether a user exists and starts sign-in or sign-up. It picks the method in this order:

  1. A passkey, when the app has passkeys on (passkeys_enabled), the browser supports WebAuthn and the user has one registered. Pass { webauthn: "disabled" } to skip it. The option takes "strict", "optional" or "disabled".
  2. A one-time code, for a phone number or when the app's email sign-in is set to codes.
  3. A magic link otherwise.

It returns { data, error } from the call it made: { magic_link: { id } } for a magic link, { otp: { ... } } for a code, a sign-in step such as mfaRequired, or { data: null, error: null } after a passkey sign-in. It has no "new user" flag. The method chosen is also reported through auth events (MAGIC_PENDING, OTP_PENDING, MAGIC_NEW_DEVICE_PENDING, OTP_NEW_DEVICE_PENDING).

Passkeys#

WebAuthn passkeys: Face ID, Touch ID, Windows Hello or a security key. On by default (passkeys_enabled).

EndpointUse
POST /webauthn/register/initialize, /webauthn/register/finalizeRegister a passkey
POST /webauthn/login/initialize, /webauthn/login/finalizeSign in with a passkey

In @scute/js-core: signInWithVerifyDevice, signInWithRegisterDevice, addDevice, isWebauthnSupported, isAnyDeviceRegistered.

A passkey sign-in skips MFA by default (webauthn_skip_mfa, default true). A required email or phone confirmation still runs first.

Scute emails a single-use link. Opening it signs the person in.

  • Endpoints: POST /magic_links/login, POST /magic_links/register, PATCH /magic_links/authenticate, POST /magic_links/status.
  • The link's token arrives in the sct_magic URL parameter. signInWithMagicLink(url) completes sign-in from it.
  • Expiry: magic_link_expiration, in seconds, default 2000, allowed 60 to 604800.

Cross-device#

The device that asked for the link can receive the session when the link is opened on another device, for example a phone. That device polls POST /magic_links/status with the link's id (getMagicLinkStatus(id), then signInWithMagicLinkId(id)). It can pick up the session for 5 minutes after the link is opened.

The workspace setting cross_device_mfa decides where MFA runs:

ValueBehavior
clicking_device (default)MFA runs on the device that opened the link. The polling device gets 409 sign_in_pending until it is done, for up to 15 minutes.
both_devicesEach device completes its own steps.

A magic link can be sent by SMS through a challenge (method: "magic_link"). The app setting sms_magic_link_mode is direct_auth (default: the link signs the person in on the web) or deep_link (the link opens your app at sms_magic_link_app_url, an https URL or your app's scheme such as myapp://sign-in, with the token in sct_magic).

One-time codes#

Email or SMS codes. Phone sign-in always uses a code. For email, the app setting email_auth_type is magic (default, links) or otp (codes). Using the method an app has turned off returns 403 sign_in_method_disabled.

  • Endpoints: POST /otps/login (email or phone), POST /otps/verify.
  • In @scute/js-core: sendLoginOtp, sendRegisterOtp, verifyOtp(otp, identifier).
  • Length: otp_length, default 6. The dashboard offers 6 or 8.
  • Expiry: otp_expiration, in seconds, default 600.

Social providers#

OAuth sign-in with these providers (the provider value in brackets):

Google (google), Microsoft (microsoft), Apple (apple), GitHub (github), GitLab (gitlab), Bitbucket (bitbucket), Facebook (facebook), LinkedIn (linkedin), Discord (discord), Slack (slack), X (twitter), Stripe (stripe), Shopify (shopify), Notion (notion), Figma (figma), Zoom (zoom), Dropbox (dropbox), Spotify (spotify), Twitch (twitch).

  • Start: GET /oauth/authorize?provider=google, or signInWithOAuthProvider("google") in @scute/js-core.
  • The provider's redirect URI is https://api.scute.io/v1/auth/:app_id/oauth/callback.
  • On success Scute redirects to your app with sct_oauth=<token>.

An OAuth sign-in is linked to an existing user with the same email only when the provider reports the email as verified. Otherwise Scute emails a magic link to that address first and redirects with sct_oauth_pending=email_verification.

SAML SSO and home-realm discovery#

A workspace can connect a SAML 2.0 identity provider and verify its email domains with a DNS TXT record. Home-realm discovery finds the identity provider from the email address:

GET https://api.scute.io/v1/auth/saml/discover?email=ada@acme.com

It looks up the email's domain among verified domains and returns workspace_id, saml_login_url and enforce_sso. An unknown domain returns 404 sso_not_available. In @scute/js-core, discoverSSO(email) returns the result or null, and signInWithSAML() starts the SAML sign-in.

When a domain enforces SSO, other methods for users at that domain return 403 sso_required with sso_login_url.

Microsoft Authenticator#

For workspaces connected to Microsoft Entra, a user can sign in by approving a push in Microsoft Authenticator with number matching.

  1. startMsAuthenticatorLogin(identifier) creates a challenge with purpose: "authenticate" and method: "entra_push".
  2. Poll getChallengeStatus(token). Show the user the number in challenge.metadata.number; they enter it in Authenticator.
  3. claimMsAuthenticatorSession(token) returns the session. It works once; a second call returns 409.

The sign-in checks#

Every sign-in passes the same checks, whatever the method. When the code or link is requested:

  1. The method is allowed for the app (and, for SMS, the country is allowed).
  2. IP rules.
  3. SSO enforcement for the email's domain.
  4. For an existing user: the workspace accepts the user, and the user is not deactivated, banned or suspended.
  5. For a new user: sign-up is open (public_signup on the workspace and the app), and the required profile fields are present. The workspace's user_info_requirement is identifier_only, name_and_identifier or strict. Missing fields return 422 incomplete_user_info with required_fields.

When the sign-in completes, Scute checks again that the user may sign in, applies IP rules to the address that finished the sign-in, runs attack protection (the app's security_level: off, low, medium (default), high, paranoid), which can block or ask for a code, and then asks for any email or phone confirmation and MFA that is owed.

Setup-only tokens#

A user who still owes a step, such as enrolling a required MFA factor or confirming an email or phone, gets a setup token instead of a session. It is an opaque scsetup_... string, not a JWT, valid for 30 minutes.

Response when MFA must be set up:

{  "mfa_required": true,  "mfa_enrollment_required": true,  "app_user_id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee",  "available_methods": ["totp", "sms", "email"],  "setup_token": "scsetup_...",  "setup_expires_at": "2026-11-19T14:30:00Z"}

Response when a contact must be confirmed: contact_verification_required: true, field (email or phone), app_user_id, and either a challenge or a setup_token.

Send the token as X-Scute-Setup-Token (or the setup_token parameter). It allows only MFA enrollment (list, enroll, verify enrollment) and adding the sign-in contact. Any other call returns 403 setup_only. An expired token returns 401 setup_expired. In @scute/js-core: enrollMfaWithSetupToken, verifyMfaEnrollmentWithSetupToken, addSignInContact.