MFA
6 Endpunkte. Basis-URL: https://xapi.ambertech.cloud/api/v1
Get current + required MFA assurance level#
/auth/mfa/aalTokenReturns `{ currentLevel, nextLevel, currentAuthenticationMethods }`. Used by the Next.js middleware to decide whether to gate on TOTP.
Antworten
- 200AAL info
curl -X GET "https://xapi.ambertech.cloud/api/v1/auth/mfa/aal" \
-H "Authorization: Bearer $XISUITE_TOKEN"Issue an MFA challenge#
/auth/mfa/challengeTokenBegins a TOTP verification cycle. The frontend then prompts the user for the 6-digit code, then calls /auth/mfa/verify with the challenge ID.
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
factorIdPflicht | string | Factor ID returned by /auth/mfa/enroll. |
Antworten
- 200Challenge issued
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/mfa/challenge" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"factorId":"…"}'Enroll a TOTP factor#
/auth/mfa/enrollTokenStarts MFA enrollment for the authenticated user. Returns the QR code, TOTP secret, and provisioning URI. The factor is in `unverified` state until /auth/mfa/verify is called with a valid TOTP code.
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
factorType | string | MFA factor type (only TOTP supported today). Werte: |
friendlyName | string | Optional friendly name for this factor (e.g., "Personal phone"). |
Antworten
- 200Enroll initiated
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/mfa/enroll" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"factorType":"totp","friendlyName":"…"}'List the user's MFA factors#
/auth/mfa/factorsTokenAntworten
- 200Factor list
curl -X GET "https://xapi.ambertech.cloud/api/v1/auth/mfa/factors" \
-H "Authorization: Bearer $XISUITE_TOKEN"Remove an MFA factor#
/auth/mfa/unenrollTokenRequest-Body
| Name | Typ | Beschreibung |
|---|---|---|
factorIdPflicht | string | Factor ID to unenroll. |
Antworten
- 200Factor removed
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/mfa/unenroll" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"factorId":"…"}'Verify a TOTP code (promotes session to aal2)#
/auth/mfa/verifyTokenVerifies the 6-digit TOTP code against an outstanding challenge. On success, rotates the auth cookies to the new aal2 token pair.
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
factorIdPflicht | string | Factor ID being verified. |
challengeIdPflicht | string | Challenge ID from /auth/mfa/challenge. |
codePflicht | string | 6-digit TOTP code from the authenticator app. |
Antworten
- 200Verified — cookies rotated
- 401Invalid code
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/mfa/verify" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"factorId":"…","challengeId":"…","code":"…"}'