-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7424132
commit a2d7719
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a2d7719
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.
@dantownsend I know this is the beginning of the implementation, but I already like it because it has some solutions that will help us later (eg if I understood correctly,
is_user_enrolled
will let us know if the user is using some MFAProvider or not and so we know which workflow the login page should use, changes tosession_login()
etc.).When I was doing server side two-factor authentication, my workflow was:
user registration -> redirect to qr code template and scan qr code -> redirect to login page and pass valid user credential -> redirect to page where we enter TOTP code from app authenticator (if the code is correct, it redirects to a protected page, if not, it returns an error)
.I like that you changed the
session_login()
so that we can change workflow since we don't have registration in Piccolo Admin: if user has MFAProvider enabledlogin page and pass valid user credential -> redirect to page where we render QR code for scaning in authenticator app -> redirect to login page and pass valid user credential again -> redirect to page to enter TOTP code from app authenticator (if the code is correct, it redirects to a protected page, if not, it returns an error)
. If user has MFAProvider disabled we use standarduser/password
session auth. Sorry to bother you with a long comment, but I like your clever solution and look forward to your progress with this.a2d7719
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.
@sinisaos Thanks! I've been considering different options for MFA, and I think just modifying the
session_login
endpoint is the simplest approach.The
session_login
endpoint can be used via API (which is what Piccolo Admin does), or will render a HTML form if you do a GET request to it. I'm trying to modify it now, so if MFA is enabled, the HTML form will show the input for the TOTP code.Once that is working and tested, we can integrate it with Piccolo Admin.