Skip to content

Conversation

@nefrob
Copy link

@nefrob nefrob commented Feb 1, 2023

Resolves #204.
Resolves #205.

Adds support for counter based 2fa codes for all 2fa methods except app/yubi key.

  • HOTP codes are guaranteed to be unique by incrementing a counter each time a code is generated
  • Consequently generating a new code invalidates the previously generated code
  • Storing a timestamp on code generation allows us to use validity windows
  • Clearing the timestamp on successful verify invalidates the current code so it can't be used again

To switch to HOTP based codes simply override the default message dispatcher used in the trench settings.

Action Items:

  • Correctly generate migrations? I ran python manage.py makemigrations from inside the test project
  • Regenerate documentation?

@nefrob nefrob marked this pull request as draft February 2, 2023 03:41
@nefrob nefrob marked this pull request as ready for review February 3, 2023 05:07
@nefrob nefrob changed the title ✨ Adds HOTP 2fa code support ✨ Adds HOTP MFA code support Feb 4, 2023
Copy link
Collaborator

@wmaciejewskimer wmaciejewskimer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@izimobil
Copy link

Hi,
Very interesting PR, do you need any help to get this merged ?
Thanks.

@nefrob
Copy link
Author

nefrob commented Jun 14, 2024

@izimobil someone with merge access on this repo would have to do it. It's been a while since I've looked at this PR/repo though so it might need some updates before then as well.

You can always fork this repo and merge this PR there if you need these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Twilio/SMS should support counter based codes Current develop branch needs makemigrations run to add 0005 migration

4 participants