Authy QR code replacement "manual entry code" - how to generate it?

799 Views Asked by At

I'm trying to implement 2FA in my application using Authy API basing on this documentation page https://www.twilio.com/docs/authy/api/users. Everything works fine but I struggle to understand how to generate auxiliary code that can be used as a replacement for QR code.

See screenshot below and field "Manual entry" (screenshot is obviously from different app but I'm targeting similar implementation) qr manual entry field in the app

I cannot find in any documentation information on how to generate this code.

I assume it can be built using QR string that later is transformed into QR image, but QR string itself is pretty long and those manual entry codes in different applications tend to be short.

1

There are 1 best solutions below

2
philnash On

Twilio developer evangelist here.

I would recommend, as the Authy documentation does, that you implement 2FA using the Twilio Verify API (which is effectively the Authy API v2).

When you implement third party authenticator applications through Verify, you create a new TOTP factor and the API response returns both the secret and the OTP URL that can be encoded as a QR code.