-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Implement 2FA authentication #1054
base: master
Are you sure you want to change the base?
Conversation
It is deviating from the core, TFM is single file manager to make easier to end user to use. Will keep this PR open, it will be useful for someone. @ner00 Thank you for the PR |
- Added JavaScript function to auto-select the OTP secret array entry and copy it to the clipboard on click; - Trimmed down some of the JS code by removing indentation and packing it in one line; this makes it slightly less readable but also keeps it from taking so much vertical space. - Some minor adjustments.
Maybe an easier and shorter 2FA implementation could be integrated in TFM, by sending a code over email through a valid SMTP indicated in the configuration. To avoid the need of saving anything, the code sent could be based on the server name, the password and it's validity time frame. |
This idea of sending an OTP code through e-mail sounds simple, but if put into practice probably not so much- even though it has some advantages, like not needing a dedicated device to store the code. The OTP code itself doesn't really need to rely on any tangible information whatsoever, as long as the user login is valid, the server could The first dependency is an e-mail address; fair enough, everyone has one, but now you need to store e-mail addresses inside TFM script, not the end of the world just yet though... The second dependency, and this is the biggest one, is the e-mail server itself. We can't simply rely on the server hosting TFM and assume that it is capable of using So, while the idea does seem appealing at first glance, it becomes less so the more you think about the implementation itself. |
it is better to use reverse proxy for advanced authentication |
Submit a PR |
qrcodejs
to generate scannable-secrets as QR codes, can also use online APIs for that.$otp_secrets
array.All resources can be tailored and/or be embedded; decided against it since there is no big difference and also because many people may not want to use 2FA, in which case they won't be bothered by extra resources being loaded online or offline.
Everything should be compatible with PHP 5.5+