SDKsGo SDKAuthentication
Multi-Factor Authentication
Enroll and verify TOTP and recovery codes with the Go SDK.
Multi-Factor Authentication
Server-side MFA operations for TOTP enrollment, verification, and recovery code management.
EnrollTOTP()
totp, err :=
VerifyTOTP()
session, err := client.Auth.VerifyTOTP(ctx, &avnologyid.VerifyTOTPParams{
Code: "482901",
})
if err != nil {
var
GenerateRecoveryCodes()
codes, err := client.Auth.GenerateRecoveryCodes(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println("Save these recovery codes:")
VerifyRecoveryCode()
session, err := client.Auth.VerifyRecoveryCode(ctx, &avnologyid.VerifyRecoveryCodeParams{
Code: "abc12-def34",
})See also
- Login -- MFA during login flow
- Error types -- Error handling