Skip to main content
All authenticator app SDK methods require you to initiate an action first. Check out our guide on TOTP authentication for more details.

Enroll TOTP

Start enrollment for a new TOTP authenticator by generating a QR code to display to the user.
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>
data
EnrollTotpResponse

Verify TOTP

Finish enrolling or re-authenticating a TOTP authenticator by verifying the code submitted by the user.
await authsignal.totp.verify(code: "123456")

Parameters

code
string
The OTP code inputted by the user.

Response

response
AuthsignalResponse<VerifyResponse>
data
VerifyResponse