1. Docs
  2. API Reference
  3. OAuth hosted login: verify the emailed MFA code

OAuth hosted login: verify the emailed MFA code

POST/oauth/mfa/email-otp/verify

Step 2 of the hosted email-OTP MFA factor: verifies the emailed code against the challenge_token. On success it optionally issues a trusted-device cookie, mints an authorization code, and redirects to redirect_uri; on failure it re-renders the challenge page in the "code sent" state with the error. Throttled to 10 requests per minute.

Request body

application/json

challenge_tokenstring Required
client_idstring Required
redirect_uristring Required
response_typestring Required
scopestring Required
statestring Optional
code_challengestring Required
code_challenge_methodstring Required
noncestring Optional
codestring Required

The one-time code received via email.

remember_deviceboolean Optional

Remember this browser so the next hosted sign-in from it skips the second factor. Honoured only when the Environment's `mfa_trusted_device_days` is above 0 (the default is 0, which disables remembering); the trust rides in the httpOnly `ca_identity_mfa_trusted_device` cookie on Canopy's domain.

Responses

text/html

string

A redirect to the client's `redirect_uri` with `code` and `state` once the sign-in clears

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Rate limit

10 requests per 1mPer caller: the signed-in user for a bearer token; for an API key, the key and the end user's address when a backend forwards it, otherwise the client address
Request
curl -X POST "https://auth.canopy-io.com/oauth/mfa/email-otp/verify" \
  -H "Content-Type: application/json" \
  -d '{
    "challenge_token": "string",
    "client_id": "string",
    "redirect_uri": "string",
    "response_type": "string",
    "scope": "string",
    "state": "string",
    "code_challenge": "string",
    "code_challenge_method": "string",
    "nonce": "string",
    "code": "string",
    "remember_device": false
  }'
Response
Content-Type: text/html

<!doctype html>
<html lang="en">
  <head>…</head>
  <body>
    <!-- The hosted page: its form, any error, and the Environment's branding -->
  </body>
</html>
Related endpoints Was this page helpful?

Tell us how we can improve this guide.