Validate a magic link token
Exchanges the single-use token from a magic link for a session.
The response depends on whether the environment requires two-factor
authentication. See the EndUserAuthResult schema for the three shapes
and how to branch on them.
Authorizations
The Auth Environment ID for the environment you are authenticating against. Find it in the Portal dashboard under Authentication > Configure.
Body
The single-use token query parameter Portal appended to your
redirect URL.
Response
Token validated successfully
The outcome of a sign-in. Which fields are set depends on whether the environment requires two-factor authentication:
- Two-factor not required.
clientId,clientSessionTokenandisAccountAbstractedare set,userJwtandtotpLinkarenull. The sign-in is complete. - Two-factor required, user already enrolled.
userJwtis set,clientId,clientSessionToken,isAccountAbstractedandtotpLinkarenull. Prompt for a code and callPOST /totps/validations. - Two-factor required, first sign-in.
userJwtandtotpLinkare both set,clientId,clientSessionTokenandisAccountAbstractedarenull. RendertotpLinkas a QR code for the user to scan, then prompt for a code and callPOST /totps/validations.
Branch on clientSessionToken being non-null to decide whether the
sign-in is finished. The client fields are only populated once the
sign-in completes, so on the two-factor branches they arrive with the
POST /totps/validations response instead.
Always null for this endpoint.