All authenticator app SDK methods require you to initiate an action first first.
Enroll TOTP
Start enrollment for a new TOTP authenticator by generating a QR code to display to the user.
iOS
Android
React Native
Flutter
let response await authsignal. totp . enroll ()
if let data = response.data {
let uri = data. uri // Convert to QR code
let secret = data. secret // Can be entered manually
}
Response
response
AuthsignalResponse<EnrollTotpResponse>
An unstructured error description present if the SDK call encountered an error.
A TOTP URI which can be converted into a QR code and presented to the user to scan with
their authenticator app.
The raw TOTP secret which can be presented to the user as a fallback option if they wish to
enter a code manually instead of scanning a QR code.
Verify TOTP
Finish enrolling or re-authenticating a TOTP authenticator by verifying the code submitted by the user.
iOS
Android
React Native
Flutter
await authsignal. totp . verify ( code : "123456" )
Parameters
The OTP code inputted by the user.
Response
response
AuthsignalResponse<VerifyResponse>
An unstructured error description present if the SDK call encountered an error.
True if the verification was successful.
A structured code present if the verification failed due to user error. Possible values are:
CODE_INVALID_OR_EXPIRED or MAX_ATTEMPTS_EXCEEDED.