Skip to content
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

Re-generate the 2FA QR code #2376

Closed
Alex-Jordan opened this issue Mar 24, 2024 · 10 comments
Closed

Re-generate the 2FA QR code #2376

Alex-Jordan opened this issue Mar 24, 2024 · 10 comments

Comments

@Alex-Jordan
Copy link
Contributor

Suppose you go to a course for the first time and scan the QR code, setting up an entity in your authenticator app. You enter the course (without checking the skip box), then log out. Then, you remove that entity from your authenticator app for some reason. Maybe just clearing out old accounts. Or maybe you lose your phone and all its data and have a new phone. Now how do you get in to the course? Unless I'm missing something, I think maybe we need a mechanism to show the QR code again if it's really needed.

@Alex-Jordan
Copy link
Contributor Author

This happened to me with a course I made once for a quick test previously. I had removed it from my authenticator app. Then I decided to go into that course for another test of something new, but I can't get in because of this reason. Deleting all cookies for this site did not help. So naturally I just tried deleting the course and then creating a new course with the same name. But I am still unable to get in (no new QR code presented), so it seems that when I deleted this course, not everything about it was cleared from the database, and that may be an additional issue.

@drgrice1
Copy link
Member

There is. If it is a student, then the user will need to contact the instructor. The instructor will then go to the "Accounts Manager" and reset two factor authentication for that user from the new form on that page that does this (the form that form some reason is not showing up now so I will check on that). If it is an instructor or admin user, then the instructor will need to contact the system administrator. The system administrator will use the wwsh script to run the bin/reset2fa script for that user.

This was all stated in #2335 (comment).

@drgrice1
Copy link
Member

If you deleted the course, then the OTP code would be deleted from the database with the user. So that would reset two factor authentication. There is no way that it could possible persist in the database as it is in the new column in the password table, and so deleted with that table.

I see that there is nothing wrong with the form on the user list. I just have two factor authentication disabled for my local test course, and it only shows up if two factor authentication is enabled.

@Alex-Jordan
Copy link
Contributor Author

OK, so what happened is that my user from the admin course gets copied to the new course. That prevents me from seeing a QR code for the new course. So I can enter the new course if I use the entry in the authenticator app for the admin course.

@drgrice1
Copy link
Member

Yes, that would be the case. I see that as a feature for admin users that are copied into a course. Then they don't have to set up two factor authentication for each course.

@drgrice1
Copy link
Member

We will need to document this. Perhaps we could add a comment in the admin course UI about this.

@Alex-Jordan
Copy link
Contributor Author

There's a related thing that I think @somiaj realized and mentioned. If I take instructor A's Fall course, I can copy it to instructo A's Spring course, including their user. This is relatively new. So their user will copy over with the OTP code. In their authenticator app, the entry will be named using the Fall course name. I don't know what to do about this except try to remain aware of it.

@Alex-Jordan
Copy link
Contributor Author

And a similar issue when unarchiving a course and giving it a new name.

@drgrice1
Copy link
Member

Yeah, the password and OTP secret will be restored with the archive. So the administrator will probably need to reset two factor authentication in those cases.

@drgrice1
Copy link
Member

These things will certainly need to be documented.

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

No branches or pull requests

2 participants