Skip to main content

Enable MFA


Use the Authentication Setup screen to enable time-based one-time password (TOTP) authentication for an authenticated account.


This screen includes:

#ElementDescription
1Modal titleDisplays Authentication setup
2Close actionDismisses the setup modal
3Setup headingExplains that authentication setup improves account security
4QR codeUsed to add the account to an authenticator app
5Secret keyManual setup key for authenticator apps
6Copy actionCopies the secret key
7Setup instructionsLists the steps to install an authenticator app, scan the QR code, and enter the generated code
8Verification code fieldRequired input for the 6-digit authenticator code
9Learn more linkOpens additional MFA information
10Cancel actionCloses setup without enabling MFA
11Verify actionSubmits the verification code
MFA Interaction Flow
+----------------+ +--------------------+ +---------------------+
| User | | Authenticator App | | Air Doctor Backend |
+----------------+ +--------------------+ +---------------------+
| | |
| Open Setup MFA Screen | |
|------------------------>| |
| | |
| Scan QR / Enter Key | |
|------------------------>| |
| | Start TOTP generation |
| |---------------------------->|
| | |
| Enter Code | |
|------------------------>| |
| | Validate Code |
| |---------------------------->|
| | |
| Success Banner & Redirect |

Workflow

  1. Open Account.
  2. Select Edit account.
  3. Select Security–2 step verification.
  4. Scan the QR code or enter the secret key in an authenticator app.
  5. Enter the 6-digit verification code.
  6. Select Verify.
  7. Return to Edit account after MFA enables.

Validations

ScenarioApp BehaviorSDK Output
Code missing or invalid formatDisable Verify and show field errorvalidation = invalid
Code expired or incorrectDisplay inline errorerror = invalid_totp
Secret registration failsDisplay error stateerror = registration_failed
Request in progressShow loading statestate = loading
MFA activation succeedsComplete setupmfa = enabled

Actions

ScenarioApp BehaviorSDK Output
Screen openedLoad QR code and secret keyMFA setup data returned
Secret key copiedCopy secret keyCopy event
Code enteredUpdate verification code statecode = updated
Verify selectedSubmit verification codeMFA enable request triggered
MFA enabledReturn to Edit Accountmfa = enabled
Cancel selectedClose setup without changesNo state change
Close selectedDismiss setup modalNo state change

Endpoint Resources

Authentication Enabled

PUT 

v3/account/mfa/enable

Returns the Authentication setup screen for enabling MFA. The response includes the setup UI, QR code, secret key, and verification code input state.

UI Element Types

LevelReferenceTypeValue
1verificationRegularAdditional verification is available
1scan-qrRegularFirst, scan this QR code with your authenticator app.
1install-appRegularYou'll need to install an authenticator app, such as Authy or Google Authenticator.
1qr-codeIllustration[QR code]
1enter-keyRegularor enter key
1secretLink[explicit code]
1enter-codeRegularNext, enter the 6-digit code generated by your authenticator app here.
1mfaIntegerVerification code
1verifyButtonVerify
1learn-moreLinkLearn more

Verify Authentication Code

POST 

v3/account/mfa/enable

Verifies the provided MFA code with the secret to enable multi-factor authentication.