POST/auth/two-factor/setup
Start authenticator setup
Operation auth.twoFactor.setup
Description
Creates a new authenticator secret for the signed-in identity and returns it as an otpauth:// URI and in base32. Nothing changes at sign-in until POST /auth/two-factor/enable confirms a code from it; starting again replaces an unconfirmed secret. An identity that already has two-factor authentication turned on gets 409.
Authentication
Requires a signed-in session: the client sends its session token as a bearer token in the Authorization header.
Responses
200 OK
application/jsonTwoFactorSetupResponse
A new authenticator secret, pending until a code confirms it.
2 fields
otpauthUristringrequired- not empty
secretstringrequired- not empty
Other fields are allowed.
Other responses
| Status | Meaning | Body |
|---|---|---|
| 401 | Unauthorized |
|
| 409 | Conflict |
|
| 500 | Internal Server Error |
|
| 503 | Service Unavailable |
|