mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 04:56:03 +03:00
[GH-ISSUE #290] auth question #252
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#252
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 @lesar on GitHub (Oct 11, 2018).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/290
Originally assigned to: @jasonmunro on GitHub.
Premise
I have an local openldap server successfully installed on my ubuntu 16.04 desktop 64bit.
in hm3.ini I have choose LDAP auth_type and
ldap_auth_base_dn="ou=mail-accounts,dc=uffalg,dc=net"in this base I have put an inetOrgPerson using this attribute:
uidname anduserPasswordset by SSHA of my psw.I have configured Cypht using this config file:
sudo vim /etc/apache2/sites-enabled/cypht.conf
I use http://localhost/mail-debug/ to see the site and it show with no error.
I cannot login using user name and password stored in my inetOrgPerson:
no error but say
Nome utente o password errati(in italy lg)Questions
What can I do to let me login?
Have I do some configuration error?
Is my ldap data wrong?
How can Cypht read ldap data if I have not give it an authorized dn user and psw?
There is in some place to put this data?
forgive my confusion
best regards,
Leonardo
@jasonmunro commented on GitHub (Oct 11, 2018):
Hi @lesar thanks for the feedback. LDAP Authentication works by using the username and password supplied to Cypht to attempt to login (or "bind" as they say) to the LDAP server, so to use LDAP authentication your intorgperson entries need to be able to login to the LDAP server itself. At this time we don't support using the LDAP server as a source to lookup usernames and compare passwords.
@lesar commented on GitHub (Oct 11, 2018):
Thank @jasonmunro for your answer.
I have supposed that the LDAP authentication works like DB authentication on similar mail client.
I have change the base
ldap_auth_base_dn="dc=uffalg,dc=net"and runconfig_gen.phpand restart apache. After this I try to login using the server ldap admin user and his password but can't login.Can you explain me how Cypht ldap authentication work?
Can you write an hm3.ini example ldap configuration explain what data Cypht expect to be in ldap database?
I have supposed that passed user login give to the user access to his login data (mail-server, mail-user, mail-psw, ...) so Cypht can open all user login account to show mail.
best regards,
Leonardo
@jasonmunro commented on GitHub (Oct 11, 2018):
All Cypht does is uses the base dn as defined, and attempts to bind to the LDAP server with the username and password you login with. If the binding works, you should be logged into Cypht. To troubleshoot this, you should try logging in with debug mode enabled and look in the PHP/webserver error log for clues. Failed logins output useful information when in debug mode so that should help narrow down the issue.
Cypht does not actually use anything from the LDAP database, it merely tries to bind with the user and password supplied for authentication.
Currently we don't support using LDAP as a source for mail server information, sorry about that. We support using LDAP as a contact store, and for authentication as described above.
Typically sites that use LDAP as a single source for authentication have both the IMAP server and the SMTP server authenticating to it. If that is true in your case, I would recommend configuring Cypht to use IMAP authentication. In that scenario Cypht authenticates to the IMAP server, which in turn uses LDAP to verify the user and password. This will also cause Cypht to automatically add that IMAP server to the user's list of accounts inside Cypht.
@lesar commented on GitHub (Oct 12, 2018):
Tanks @jasonmunro,
I actually have no error in debug mode on display and this error on apache error.log:
I am using php-fpm and in my php.ini have:
sudo cat /etc/php/7.0/fpm/php.ini | grep -v ";" | grep errorregards,
Leonardo
@lesar commented on GitHub (Oct 12, 2018):
Stop I have solved:
Looking in your code I notice in auth.php line 337:
$user = sprintf('cn=%s,%s', $user, $base_dn);I in my login have use the full user DN and not only the user name. sorry.
Using only the name it work.
best regards,
Leonardo