Skip to content

Begin enrollment during login

POST
/api/v1/login/mfa/enroll/begin
curl --request POST \
--url https://osctrl.net/api/v1/login/mfa/enroll/begin \
--header 'Content-Type: application/json' \
--data '{ "challenge": "example", "code": "example" }'

Returns a TOTP secret for a user who must enroll before logging in.

Request body

Media typeapplication/json
object
challenge
string
code
string
Examplegenerated
{
"challenge": "example",
"code": "example"
}

OK

Media typeapplication/json
object
qr

QR is the provisioning URI as a PNG data URI, ready for an .

string
secret
string
uri
string
Examplegenerated
{
"qr": "example",
"secret": "example",
"uri": "example"
}

Forbidden

Media typeapplication/json
object
code
string
error
string
Examplegenerated
{
"code": "example",
"error": "example"
}

Not found

Media typeapplication/json
object
code
string
error
string
Examplegenerated
{
"code": "example",
"error": "example"
}

Internal server error

Media typeapplication/json
object
code
string
error
string
Examplegenerated
{
"code": "example",
"error": "example"
}