POST/auth/two-factor/enable
Turn on two-factor authentication
Operation auth.twoFactor.enable
Description
Confirms the pending authenticator with its current code and turns on two-factor authentication. The response carries ten single-use recovery codes, shown only once. The calling session counts as having passed a second factor; the identity's other sessions are revoked, so each device signs in again with a code. A wrong code returns 400 and repeated wrong codes lock code entry for a while with 429.
Authentication
Requires a signed-in session: the client sends its session token as a bearer token in the Authorization header.
Request body
application/jsonTwoFactorEnableRequest
Confirms a pending authenticator with its current code, turning two-factor on.
2 fields
codestringrequired- 1 to 32 characters
The authenticator's current six-digit code.
rememberDevicebooleanrequiredTrue to also receive a device token for this device's later sign-ins.
Other fields are allowed.
Responses
200 OK
application/jsonTwoFactorEnableResponse
Two-factor is on: the recovery codes, shown once, and the device token if one was asked for.
3 fields
deviceTokenstringoptional- not empty
enabledbooleanrequired- always
true
- always
recoveryCodeslist of stringrequired- each item: not empty
Other fields are allowed.
Other responses
| Status | Meaning | Body |
|---|---|---|
| 400 | Bad Request |
|
| 401 | Unauthorized |
|
| 409 | Conflict |
|
| 429 | Too Many Requests |
|
| 500 | Internal Server Error |
|
| 503 | Service Unavailable |
|