mirror of
https://github.com/antonioribeiro/google2fa.git
synced 2026-04-25 16:15:49 +03:00
[GH-ISSUE #173] Is it possible to add enable 2FA using this library via a code (i.e. not using a QR code)? #81
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/google2fa#81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @shanehoban on GitHub (Mar 12, 2022).
Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/173
Using Authy as an example, in the cases where the user cannot scan a QR code, you have the ability to enter a code to enable 2FA:
Can this library support this option or is this something that can be implemented?
Thanks, otherwise this works flawlessly, much appreciated!
Edit: Image example
@antonioribeiro commented on GitHub (Jun 13, 2022):
The QRCode composed by an address like this:
What you are looking for is probably the just "secret key", which is the one responsible for generating the codes on your phone, that you may be already using like this:
Authy is doing is probably encoding that secret key using an internal algorithm, but if in the end if they are using the same OTP Google algorithm, they have to use the exact same secret key generation this package uses.
The risk of losing a QRCode and a secret key are the same, if you loose one of them your account is already compromised, so maybe you don't even need to double encode it (but, honestly, I would!) and you could just do