We are using Amplify, Cognito and Angular to build a login workflow. During setup of TOTP, we show a QR code to the user.
As good practice, we also want to allow the user to manually enter a "setup code" in case they can't use the QR code.
I can't really find any specific documentation on this, but it seems like some people suggest having a "Copy to Clipboard" button, that copies the result of Auth.setupTOTP()
so that it can then be copied into Google Authenticator or Authy, or whatever the user is using to manage their MFA.
The problem is that:
- Users typically setup TOTP on their desktop computer, with a cellphone as their two factor authentication. Therefore the 'Copy to Clipboard' technique is useless. They have to manually type in the code.
- The code is 52 characters long! No one in their right mind will want to type in 52 characters.
Is there a way to get a shorter code, e.g. up to 16 characters?