Replies: 1 comment 5 replies
-
First, I'm not sure it's a good idea to offer a generic download feature for recovery codes. It does make it easier on the user, but it's less likely the user will put thought into how the recovery codes should be stored. I think there is an easier solution. You could add a form on the page where you can view the recovery codes, which will submit the recovery codes to the server, and the server can just take the submitted data and return it as an attachment. That avoids the freshness issue, and there are no security concerns, because the server is only returning the input in a new format. What are your thoughts on that? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In my upcoming screencast about multifactor authentication, I'm planning to show how to build a link for downloading recovery codes, which I often saw in other apps next to the actual recovery codes.
My initial version just featured a download endpoint, which called
rodauth.require_authentication
, and rendered the recovery codes. However, I realized this decreased the security, because it made it possible to retrieve recovery codes without entering the password.My next version was to build the download link in plain JavaScript, passing it the recovery codes at render time. Given that this download link was only displayed alongside rendered recovery codes, it seemed to maintain the same level of security.
However, I was thinking whether there is a JS-free way of keeping both security and UX. Initially I was thinking of making the download button a POST form where the user has to enter their password. However, given that they already entered the password to view the recovery codes, that would harm UX.
I then thought about using
password_grace_period
and only displaying the password if it hasn't recently been entered. However, then I would have to handle the scenario of the user keeping the recovery codes page open until the password grace period expires, and only then clicking at the download link, which didn't seem trivial.The most recent idea I had yesterday was to combine
password_grace_period
withconfirm_password
, so that the user is redirected to the password confirmation page if the password grace period expires. However, in that case, the recovery codes download would start while they were still on the password confirmation page, which I didn't consider good UX.I was wondering what are your thoughts on that?
Beta Was this translation helpful? Give feedback.
All reactions