[GH-ISSUE #169] Don't ask for 2FA code every time #78

Closed
opened 2026-02-25 20:32:21 +03:00 by kerem · 3 comments
Owner

Originally created by @pdolinaj on GitHub (Jun 28, 2021).
Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/169

I'm not sure whether this is bug or a feature requirement but in many 2FA implementations user can select "Don't ask for 2FA code for XXX days." and then after we enter the 2FA once successfully, the app won't ask us to enter it for XXX days again. Can this be achieved with this app?

Originally created by @pdolinaj on GitHub (Jun 28, 2021). Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/169 I'm not sure whether this is bug or a feature requirement but in many 2FA implementations user can select "Don't ask for 2FA code for XXX days." and then after we enter the 2FA once successfully, the app won't ask us to enter it for XXX days again. Can this be achieved with this app?
kerem closed this issue 2026-02-25 20:32:22 +03:00
Author
Owner

@marcinlawnik commented on GitHub (Jun 28, 2021):

This is something you have to implement yourself, by saving last successful 2FA attempt time and then checking whether the time has passed. It can be achieved with this library. This is a library, not a ready app ;)

<!-- gh-comment-id:869691052 --> @marcinlawnik commented on GitHub (Jun 28, 2021): This is something you have to implement yourself, by saving last successful 2FA attempt time and then checking whether the time has passed. It can be achieved with this library. This is a library, not a ready app ;)
Author
Owner

@zyglobe commented on GitHub (Sep 1, 2021):

Just to add to that, usually implementations will try to pair a fingerprinted device to the 'remembered' user so that there are assurances that you're not allowing a bad actor to log in with your password from another device and not get prompted for MFA.

<!-- gh-comment-id:910605283 --> @zyglobe commented on GitHub (Sep 1, 2021): Just to add to that, usually implementations will try to pair a fingerprinted device to the 'remembered' user so that there are assurances that you're not allowing a bad actor to log in with your password from another device and not get prompted for MFA.
Author
Owner

@antonioribeiro commented on GitHub (Sep 1, 2021):

I believe this what the "remember me" (Laravel example) feature does, nor not? Authenticated user is tied to an encrypted token, stored on a cookie on each device. Any attempt to mess with the cookie destroys it and logoff the user.

And, yes, as @marcinlawnik said, this package cannot be responsible for anything beyond the generation and checking of one time passwords.

<!-- gh-comment-id:910878787 --> @antonioribeiro commented on GitHub (Sep 1, 2021): I believe this what the ["remember me" (Laravel example)](https://laravel.com/docs/8.x/authentication#remembering-users) feature does, nor not? Authenticated user is tied to an encrypted token, stored on a cookie on each device. Any attempt to mess with the cookie destroys it and logoff the user. And, yes, as @marcinlawnik said, this package cannot be responsible for anything beyond the generation and checking of one time passwords.
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/google2fa#78
No description provided.