-
-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the possibility for the user to change the double authentication #380
base: master
Are you sure you want to change the base?
Add the possibility for the user to change the double authentication #380
Conversation
8fdb088
to
81efb63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's quite a lot of templates you've added to the example app and I'm not quite sure why they're necessary (and why those changes aren't just in two_factor
itself if they are necessary).
Also tests are not optional!
two_factor/views/core.py
Outdated
key = random_hex_str(20) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why all these random newlines? I don't see how they are related to your proposed change.
session_key_name = 'django_two_factor-qr_secret_key' | ||
|
||
form_list = ( | ||
('generator', TOTPDeviceForm), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's only one form here, what about yubikey and phone methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exactly the point: this view is used when you already have a phone as double authentication method and want to go to the generator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if I want to change to another method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well then you have the other view that allows you to go from the token generator to the SMS/call. You can only have one method for double authentication at a time. If you previously were using the google authenticator, you'll arrive on the view to use SMS/call. If you previously were using the SMS/call, you'll arrive on the view to use google authenticator. If you want to add extra backup tokens or phone etc nothing changes. All of this assumes you already have enable the double authentication method. If not, then you are still pointing to the initial setup view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what about yubikey?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add this one. My bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests are added, the case of yhe use of a yubikey is also considered
I added a bunch of templates because the example was not working initially....a bunch of templates were actually missing to make it work due to a change in the settings for the repository of templates (or I missed something?). I'll write tests. |
7328022
to
59f4bc7
Compare
59f4bc7
to
c24cedf
Compare
Add the possibility for the user to change the double authentication
Description
From the profile view, the user can now switch between Google authenticator/ sms or call method for double authentication.
Motivation and Context
This solves the issue reported in #347
How Has This Been Tested?
No new test was added, however the example repository has been updated to take the change into account. This can then be tested locally by using the example repository
Types of changes
Checklist: