Skip to Content
MuoCeon Docs
v1auth contextCredential management

Authenticator app

Binding a TOTP authenticator — issuing the secret and checking the first code.

An authenticator app (TOTP) is a second factor. Each account can bind exactly one.

Endpoints

MethodPathPurposeStep-up
POST/v1/auth/credentials/authenticator/optionsIssue the secretmax_age=300
POST/v1/auth/credentials/authenticatorCheck the first code, then persistNone

Step one: issue the secret

No request body.

{
  "success": true,
  "secret": "JBSWY3DPEHPK3PXP",
  "otpauth_uri": "otpauth://totp/MuoCeon:alice?secret=JBSWY3DPEHPK3PXP&issuer=MuoCeon",
  "expires_in": 300
}

The server returns only the otpauth:// URI, never a rendered QR image: encoding the image belongs on the client, and doing it server-side would pass a one-time secret through an extra encoding round-trip.

Step two: confirm

ParameterTypeRequiredNotes
codestring✅The code currently shown by the app, 4–16 chars
{ "success": true, "credential": { "id": "cred_...", "type": "authenticator" } }

Why check a code first

Verifying once before persisting surfaces a pairing mistake at binding time instead of at the next sign-in. The secret stays readable until a code matches, so a mistyped code can be retried with the same secret rather than forcing the user to scan again.

On this page