Skip to main content
POST
Validate a magic link token

Authorizations

x-portal-auth-environment-id
string
header
required

The Auth Environment ID for the environment you are authenticating against. Find it in the Portal dashboard under Authentication > Configure.

Body

application/json
token
string
required

The single-use token query parameter Portal appended to your redirect URL.

Response

Token validated successfully

data
object

The outcome of a sign-in. Which fields are set depends on whether the environment requires two-factor authentication:

  • Two-factor not required. clientSessionToken is set, userJwt and totpLink are null. The sign-in is complete.
  • Two-factor required, user already enrolled. userJwt is set, clientSessionToken and totpLink are null. Prompt for a code and call POST /totps/validations.
  • Two-factor required, first sign-in. userJwt and totpLink are both set, clientSessionToken is null. Render totpLink as a QR code for the user to scan, then prompt for a code and call POST /totps/validations.

Branch on clientSessionToken being non-null to decide whether the sign-in is finished.

metadata
object | null

Always null for this endpoint.