So basically I want to achieve something similar to Google's two-factor authentication. My login form consists of a wizard with 2 steps:
- Step 1 (check username and password)
- Step 2 (Security Token Authentication)
Usage Scenarios:
- The user has a security token associated with his account: logs in the user if the user goes through steps 1 and 2
- The user does not have a security token: writes the user to the right after he passes only step 1
I am subclassing the django Form Wizard, which will now be used as my login. In step 2, by default, Django FormWizard will include the field values from previously submitted forms as hidden fields. But, as you know, the password is entered in step 1, so I do not want to enable it in step 2 for security reasons.
My first thought was to use a session to indicate whether the user has gone through Step 1, so I don’t need to include the field values from step 1, but I can ignore something at all. What are safer solutions for this?
Also, I do not quite understand the use of the security hash in FormWizard. Can someone explain?
Many thanks.
authentication django django-formwizard
Edwin
source share