mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 04:56:03 +03:00
[GH-ISSUE #670] Touble enabling 2FA for login #438
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#438
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @knightsg on GitHub (Feb 14, 2023).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/670
💬 Question
I've set up the 2fa module by uncommenting the module line in hm3.ini, setting a secret in the 2fa.ini file and moving it to the app_data dir. If I log into Cypht and go to site settings I see the option for 2FA, I can scan the QR code and enable 2FA using the checkbox, then save the setting. However, when I try to log out of Cypht so I can log back in to try it, I get a popup box saying I need to enter my passed to save settings.
I've done this and logged out, but when I log back in I don't get any 2FA prompt and if I go back to the 2FA settings again the checkbox is not selected. I've tried the same process a few extra times with no change. If I follow the process to enable 2FA and then browse around the site without trying to log out, I don't get the popup, and if I go back to 2FA settings the checkbox is still selected. I've also tried instead selecting "Just logout" when the popup shows, but I get the same result.
In case it helps here are the cypht log lines when I save the 2FA setting:
mailserver-cypht-1 | NOTICE: PHP message: Array
mailserver-cypht-1 | (
mailserver-cypht-1 | [0] => Using Hm_PHP_Session with Hm_Auth_IMAP
mailserver-cypht-1 | [1] => Using file based user configuration
mailserver-cypht-1 | [2] => Using sapi: fpm-fcgi
mailserver-cypht-1 | [3] => Request type: HTTP
mailserver-cypht-1 | [4] => Request path: /
mailserver-cypht-1 | [5] => TLS request: 0
mailserver-cypht-1 | [6] => Mobile request: 0
mailserver-cypht-1 | [7] => Page ID: settings
mailserver-cypht-1 | [8] => CACHE backend using: noop
mailserver-cypht-1 | [9] => LOGGED IN
mailserver-cypht-1 | [10] => Setting cookie: name: hm_reload_folders, lifetime: 0, path: , domain: localhost, secure: , html_only
mailserver-cypht-1 | [11] => Setting cookie: name: hm_msgs, lifetime: 0, path: /, domain: localhost, secure: , html_only 1
mailserver-cypht-1 | [12] => Redirecting to /?page=settings
mailserver-cypht-1 | [13] => PHP version 8.2.2
mailserver-cypht-1 | [14] => Zend version 4.2.2
mailserver-cypht-1 | [15] => Peak Memory: 8192
mailserver-cypht-1 | [16] => PID: 13
mailserver-cypht-1 | [17] => Included files: 112
mailserver-cypht-1 | )
mailserver-cypht-1 | 172.30.0.4 - 14/Feb/2023:07:36:29 +0000 "POST /index.php" 303
mailserver-cypht-1 | NOTICE: PHP message: Array
mailserver-cypht-1 | (
mailserver-cypht-1 | [0] => Using Hm_PHP_Session with Hm_Auth_IMAP
mailserver-cypht-1 | [1] => Using file based user configuration
mailserver-cypht-1 | [2] => Using sapi: fpm-fcgi
mailserver-cypht-1 | [3] => Request type: HTTP
mailserver-cypht-1 | [4] => Request path: /
mailserver-cypht-1 | [5] => TLS request: 0
mailserver-cypht-1 | [6] => Mobile request: 0
mailserver-cypht-1 | [7] => Page ID: settings
mailserver-cypht-1 | [8] => CACHE backend using: noop
mailserver-cypht-1 | [9] => LOGGED IN
mailserver-cypht-1 | [10] => Deleting cookie: name: hm_msgs, lifetime: 1676356589, path: /, domain: localhost, secure: , html_only 1
mailserver-cypht-1 | [11] => TRANSLATION NOT FOUND :Attachment Chunks:
mailserver-cypht-1 | [12] => TRANSLATION NOT FOUND :Farsi:
mailserver-cypht-1 | [13] => TRANSLATION NOT FOUND :Estonian:
mailserver-cypht-1 | [14] => TRANSLATION NOT FOUND :Indonesian:
mailserver-cypht-1 | [15] => TRANSLATION NOT FOUND :Too Dark:
mailserver-cypht-1 | [16] => TRANSLATION NOT FOUND :Don't flag a message as read on open:
mailserver-cypht-1 | [17] => TRANSLATION NOT FOUND :Default message sort order:
mailserver-cypht-1 | [18] => TRANSLATION NOT FOUND :Update your settings with the code below:
mailserver-cypht-1 | [19] => TRANSLATION NOT FOUND :If you can't use the QR code, you can enter the code below manually (no line breaks):
mailserver-cypht-1 | [20] => PHP version 8.2.2
mailserver-cypht-1 | [21] => Zend version 4.2.2
mailserver-cypht-1 | [22] => Peak Memory: 10240
mailserver-cypht-1 | [23] => PID: 12
mailserver-cypht-1 | [24] => Included files: 113
mailserver-cypht-1 | )
mailserver-cypht-1 | 172.30.0.4 - 14/Feb/2023:07:36:29 +0000 "GET /index.php" 200
mailserver-cypht-1 | 172.30.0.4 - 14/Feb/2023:07:36:29 +0000 "POST /index.php" 200
mailserver-cypht-1 | NOTICE: PHP message: Array
mailserver-cypht-1 | (
mailserver-cypht-1 | [0] => Using Hm_PHP_Session with Hm_Auth_IMAP
mailserver-cypht-1 | [1] => Using file based user configuration
mailserver-cypht-1 | [2] => Using sapi: fpm-fcgi
mailserver-cypht-1 | [3] => Request type: AJAX
mailserver-cypht-1 | [4] => Request path: /
mailserver-cypht-1 | [5] => TLS request: 0
mailserver-cypht-1 | [6] => Mobile request: 0
mailserver-cypht-1 | [7] => Page ID: ajax_hm_folders
mailserver-cypht-1 | [8] => CACHE backend using: noop
mailserver-cypht-1 | [9] => LOGGED IN
mailserver-cypht-1 | [10] => Deleting cookie: name: hm_reload_folders, lifetime: 1676356589, path: , domain: localhost, secure: , html_only
mailserver-cypht-1 | [11] => TRANSLATION NOT FOUND :Highlights:
mailserver-cypht-1 | [12] => TRANSLATION NOT FOUND :Hide folders:
mailserver-cypht-1 | [13] => PHP version 8.2.2
mailserver-cypht-1 | [14] => Zend version 4.2.2
mailserver-cypht-1 | [15] => Peak Memory: 8192
mailserver-cypht-1 | [16] => PID: 13
mailserver-cypht-1 | [17] => Included files: 71
mailserver-cypht-1 | )
This block is when I've configured 2FA and try to log out using the "save and logout" option that pops up:
mailserver-cypht-1 | NOTICE: PHP message: Array
mailserver-cypht-1 | 172.30.0.4 - 14/Feb/2023:07:37:44 +0000 "POST /index.php" 303
mailserver-cypht-1 | (
mailserver-cypht-1 | [0] => Using Hm_PHP_Session with Hm_Auth_IMAP
mailserver-cypht-1 | [1] => Using file based user configuration
mailserver-cypht-1 | [2] => Using sapi: fpm-fcgi
mailserver-cypht-1 | [3] => Request type: HTTP
mailserver-cypht-1 | [4] => Request path: /
mailserver-cypht-1 | [5] => TLS request: 0
mailserver-cypht-1 | [6] => Mobile request: 0
mailserver-cypht-1 | [7] => Page ID: settings
mailserver-cypht-1 | [8] => CACHE backend using: noop
mailserver-cypht-1 | [9] => LOGGED IN
mailserver-cypht-1 | [10] => Deleting cookie: name: hm_session, lifetime: 1676356664, path: /, domain: localhost, secure: , html_only 1
mailserver-cypht-1 | [11] => Deleting cookie: name: hm_id, lifetime: 1676356664, path: /, domain: localhost, secure: , html_only 1
mailserver-cypht-1 | [12] => Deleting cookie: name: hm_reload_folders, lifetime: 1676356664, path: , domain: localhost, secure: , html_only
mailserver-cypht-1 | [13] => Deleting cookie: name: hm_msgs, lifetime: 1676356664, path: /, domain: localhost, secure: , html_only 1
mailserver-cypht-1 | [14] => Setting cookie: name: hm_msgs, lifetime: 0, path: /, domain: localhost, secure: , html_only 1
mailserver-cypht-1 | [15] => Redirecting to /?page=settings
mailserver-cypht-1 | [16] => PHP version 8.2.2
mailserver-cypht-1 | [17] => Zend version 4.2.2
mailserver-cypht-1 | [18] => Peak Memory: 8192
mailserver-cypht-1 | [19] => PID: 12
mailserver-cypht-1 | [20] => Included files: 112
mailserver-cypht-1 | )
mailserver-cypht-1 | NOTICE: PHP message: Array
mailserver-cypht-1 | 172.30.0.4 - 14/Feb/2023:07:37:44 +0000 "GET /index.php" 200
mailserver-cypht-1 | (
mailserver-cypht-1 | [0] => Using Hm_PHP_Session with Hm_Auth_IMAP
mailserver-cypht-1 | [1] => Using file based user configuration
mailserver-cypht-1 | [2] => Using sapi: fpm-fcgi
mailserver-cypht-1 | [3] => Request type: HTTP
mailserver-cypht-1 | [4] => Request path: /
mailserver-cypht-1 | [5] => TLS request: 0
mailserver-cypht-1 | [6] => Mobile request: 0
mailserver-cypht-1 | [7] => Page ID: settings
mailserver-cypht-1 | [8] => CACHE backend using: noop
mailserver-cypht-1 | [9] => Deleting cookie: name: hm_msgs, lifetime: 1676356664, path: /, domain: localhost, secure: , html_only 1
mailserver-cypht-1 | [10] => TRANSLATION NOT FOUND :Cypht:
mailserver-cypht-1 | [11] => PHP version 8.2.2
mailserver-cypht-1 | [12] => Zend version 4.2.2
mailserver-cypht-1 | [13] => Peak Memory: 8192
mailserver-cypht-1 | [14] => PID: 13
mailserver-cypht-1 | [15] => Included files: 68
mailserver-cypht-1 | )
FYI I am using IMAP auth provided by a container running docker-mailserver.
@marclaporte commented on GitHub (Feb 19, 2023):
If you supply me a test account (send me info in private), I can assign a junior dev to investigate. You can find me in here: https://app.gitter.im/#/room/#cypht-org_community:gitter.im
@josaphatim commented on GitHub (Mar 21, 2023):
This is what i get after setting up 2fa module. I faced the same issues. To overcome just ensure.
Thanks.
@knightsg commented on GitHub (Mar 21, 2023):
Thanks, I'll check through my config and do some more testing and let you know how it goes 👍
@knightsg commented on GitHub (Mar 22, 2023):
@marclaporte It worked! The missing element was ensuring the user settings directory was writable by the fpm process group in my container.
Thank you, I appreciate your help with this!