WayneLambert / portfolio

Portfolio site demonstrating skills with Python, Django, JavaScript, HTML, Sass, PostgreSQL, pytest, Docker, and Git.
https://waynelambert.dev
6 stars 1 forks source link

Two-Factor Authentication #107

Open WayneLambert opened 3 years ago

WayneLambert commented 3 years ago

This issue tracks the implementation of using either a device or email token as a second factor in their multi-factor authentication process.

WayneLambert commented 3 years ago

Features To Include

WayneLambert commented 3 years ago

Testing Scenarios for LoginView

WayneLambert commented 3 years ago

The testing scenarios outlined in this comment have been tested and the code works as expected.

donald-trump now has an entry in the database for a token authentication in addition to an expired email token. How does logging in as donald now work?

WayneLambert commented 3 years ago

The testing scenarios outlined in this comment have been tested and the code works as expected.

donald-trump now has an entry in the database for a token authentication in addition to an expired email token. How does logging in as donald now work?

Due to the hierarchy of logic, Donald is presented with the opportunity to choose their method of 2FA again.

WayneLambert commented 3 years ago

Need to make a decision on how long the token should be valid for weighing security against convenience.

WayneLambert commented 3 years ago

Can I use FormView instead of TemplateView? Or can I manually declare the single form within the post method which would give me access to the form object enabling access to cleaned_data and errors.

WayneLambert commented 3 years ago

Can I use FormView instead of TemplateView? Or can I manually declare the single form within the post method which would give me access to the form object enabling access to cleaned_data and errors.

The post method included an instantiation of the form enabling access to the form data rather than the POST data.

WayneLambert commented 3 years ago

The ProfileView and the ProfileUpdateView are two examples of views that should only be available within the project for users that have two-factor authenticated.

Other examples include the PostUpdateView.

These should be used as the examples to include a custom mixin and for their corresponding tests to be adapted to emulate being two-factor authenticated.

WayneLambert commented 3 years ago

The ProfileView and the ProfileUpdateView are two examples of views that should only be available within the project for users that have two-factor authenticated.

Other examples include the PostUpdateView.

These should be used as the examples to include a custom mixin and for their corresponding tests to be adapted to emulate being two-factor authenticated.

The ProfileView is an example of where multiple permutations of the test has been set up to ensure that the intended outcome happens for each authentication status attempting to access the view.

WayneLambert commented 3 years ago
WayneLambert commented 2 years ago
WayneLambert commented 2 years ago

Replace the django-cryptography package with the django-encrypted-model-fields. This is a more frequently maintained package and will not prevent the upgrade path.