This factor operates by generating a One-Time Password (OTP) on-demand through an application which is called an Authenticator App. The application is seeded with a shared secret upon setup, allowing it to continuously generate a new code every 30 seconds, and our service to validate the code in combination with the exact time. Hence why this factor is also called Time-Based One-Time Password (TOTP).
This factor supports all generally-used authenticator apps through the OATH TOTP standard (RFC 6238), for example:
Next to the general configuration options, TOTP factors have following configuration options:
config.issuer: string) - The name shown for the entry in the authenticator app, e.g. your company or application name. Defaults to Quasr.config.require_validation_for_enablement: boolean) - Whether a new enrollment must first be validated with a code before it's enabled. Defaults to true.config.expires_in: string) - How long users have to validate a new enrollment, defaults to 10m.Following settings are fixed:
config.window: 30s), which are the defaults of all common authenticator appsUsers enroll in following steps, in the Login UI during signup or later on in the Account UI:
otpauth:// URI, which the UI shows as a QR code together with the setup key (the secret itself).Enrolling at signup
Logging in with the code from the app
An enrollment that isn't validated before it expires (see Expires In) is deleted, and the user has to start over.
Admins can also create a TOTP enrollment for an internal user, e.g. to hand over a pre-configured device, in which case the Admin UI shows the QR code and setup key once. See Users — Enrollments.
At login the user enters the code currently shown by their authenticator app for the enrollment. Following applies:
The secret of an enrollment can't be changed. If a user loses or replaces their device, disable or delete the enrollment and let the user enroll again with their new device. See Users — Enrollments.
TOTP enrollments can't be found with searchEnrollments, as their secret isn't a value that identifies the user.
Below are the steps for the factors endpoint of the Authentication API. See Factors — Authentication API for how requests, responses, sessions and the Management API work in general.
1. With the signup session token, send the ID of the TOTP factor without input. This creates a pending enrollment and returns the otpauth:// URI (initialization_url) to show as QR code, and the setup key (secret):
POST /factors HTTP/1.1Host: {tenant_id}.api.quasr.ioAuthorization: Bearer {signup_session_token}Content-Type: application/json [ { "id": "{totp_factor_id}" }]{ "result": "PENDING", "feedback": { "cause": "ENROLLMENT_PENDING", "enrollment_id": "{enrollment_id}", "expires_at": "2026-11-06T10:10:00.000Z", "initialization_url": "otpauth://totp/{issuer}:{account_id}?secret={secret}&issuer={issuer}", "secret": "{secret}", "regex": "^[0-9]{6}$" }}2. Send the code shown by the authenticator app with the ID of the enrollment, which completes the enrollment:
POST /factors HTTP/1.1Host: {tenant_id}.api.quasr.ioAuthorization: Bearer {signup_session_token}Content-Type: application/json [ { "id": "{enrollment_id}", "input": "123456" }]After the user is identified with another factor, send the code with the ID of the TOTP enrollment and the session token:
POST /factors HTTP/1.1Host: {tenant_id}.api.quasr.ioAuthorization: Bearer {session_token}Content-Type: application/json [ { "id": "{totp_enrollment_id}", "input": "123456" }]{ "result": "SUCCESS", "feedback": { "cause": "", "enrollment_id": "{totp_enrollment_id}" }, "account_id": "{account_id}", "session_token": "{session_token}", "session_score": 4, "session_exp": 1767225600}A signed-in user adds an authenticator app with createEnrollment, which returns the otpauth:// URI in output, and completes it with updateEnrollment and a code:
mutation { createEnrollment(input: { account: "{account_id}", factor: "{totp_factor_id}", subtype: "totp", status: ENABLED }) { id status output }} mutation { updateEnrollment(input: { id: "{enrollment_id}", input: "123456" }) { id status }}