sdk.mfa - Multi-Factor Authentication
getUserDevices
Get all MFA devices for the authenticated user.Returns
List<MfaDevice>- List of MFA devices
Example
addDevice
Add a new MFA device (TOTP authenticator).Parameters
- type (String) - The device type (typically “totp” for authenticator apps)
Returns
- MfaAddDevice - Device information including the secret for QR code generation
Example
verifyDevice
Verify a newly added MFA device with a TOTP code.Parameters
- code (String) - The 6-digit TOTP code from the authenticator app
- type (String) - The device type (typically “totp”)
Example
authenticateDevice
Authenticate with an MFA device to get an MFA token.Parameters
- params (MfaAuthenticateDevice) - Authentication parameters:
code(String) - The TOTP codedeviceId(String) - The device IDcreateMfaToken(MfaCreateToken) - Token creation parameters
Returns
- String? - The MFA authentication token
Example
deleteUserDevice
Delete an MFA device. Requires an MFA authentication token.Parameters
- deviceId (String) - The ID of the device to delete
- mfaAuthToken (String) - MFA token obtained from
authenticateDevice
Example
getRecoveryCodes
Get recovery codes for MFA. Optionally generate new codes.Parameters
- generateNewCodes (Boolean) - Whether to generate new recovery codes (default: false)
Returns
List<String>- List of recovery codes
Example
acknowledgeRecoveryCodes
Mark recovery codes as shown to the user.Example
authenticateRecoveryCode
Authenticate using a recovery code.Parameters
- code (String) - The recovery code
Example
sdk.passkeys - Passkey Management
getPasskeys
Get all passkeys for the authenticated user.Returns
List<UserPasskey>- List of user passkeys
Example
registerPasskey
Register a new passkey using the device’s biometric authentication.Example
authenticatePasskeyMFA
Authenticate with a passkey for MFA purposes, generating an MFA token.Parameters
- createMfaToken (MfaCreateToken) - Token creation parameters
- relatedOriginRpId (String?) - Optional related origin RP ID (typically null)
Returns
- PasskeyAuthenticationResponse - Response containing JWT token
Example
deletePasskey
Delete a passkey.Parameters
- request (DeletePasskeyRequest) - Request containing the passkey ID