MFA Operations
getUserDevices
Fetch all MFA devices for the authenticated user.MfaDevice objects
Example:
addDevice
Add a new TOTP device for the user.type- Device type (e.g.,"totp")
MfaAddDevice containing the secret for authenticator setup
Example:
verifyDevice
Verify a newly added device with a TOTP code.code- The 6-digit TOTP code from the authenticator apptype- Device type (e.g.,"totp")
authenticateDevice
Authenticate an MFA device with a TOTP code.params- Authentication parameters including code, device ID, and token options
deleteUserDevice
Delete an MFA device from the user’s account.deviceId- ID of the device to deletemfaAuthToken- MFA authentication token
getRecoveryCodes
Retrieve backup recovery codes for the user.generateNewCodes- Whether to generate new codes or retrieve existing ones
getNewRecoveryCodes
Generate new recovery codes, invalidating old ones.isPendingRecoveryCodesAcknowledgment
Check if recovery codes need acknowledgment.completeAcknowledgement
Acknowledge that user has saved their recovery codes.authenticateRecoveryCode
Authenticate using a recovery code.code- Recovery code and token creation options
Passkey Operations
signIn
Sign in using an existing passkey.SdkUser object for the authenticated user
Example:
registerPasskey
Register a new passkey for the authenticated user.getPasskeys
Fetch all passkeys registered for the user.UserPasskey objects
Example:
authenticatePasskeyMFA
Authenticate with a passkey for MFA.createMfaToken- Token creation optionsrelatedOriginRpId- Optional related origin RP ID
PasskeyMfaResponse containing JWT token
Example:
deletePasskey
Delete a passkey from the user’s account.request- Delete request containing the passkey ID
Data Types
MfaDevice
Represents an MFA device.MfaAddDevice
Result of adding a new MFA device.MfaAuthenticateDevice
Parameters for device authentication.MfaCreateToken
Token creation options for MFA.MfaAuthenticateRecoveryCode
Parameters for recovery code authentication.UserPasskey
Represents a user’s passkey.DeletePasskeyRequest
Request to delete a passkey.PasskeyMfaResponse
Response from passkey MFA authentication.Error Handling
All MFA and passkey operations can throw errors. Handle them appropriately:See Also
- MFA Guide - Complete guide to implementing MFA
- Passkey Authentication - Passkey setup and usage
- Authentication Guide - Basic authentication methods