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

[LDAP接入问题] 账户信息不合法 #226

Closed
LiukerSun opened this issue Oct 23, 2023 · 2 comments
Closed

[LDAP接入问题] 账户信息不合法 #226

LiukerSun opened this issue Oct 23, 2023 · 2 comments

Comments

@LiukerSun
Copy link

LiukerSun commented Oct 23, 2023

版本:1.3.2
dockerfile build的image.


做了什么修改:
参考了 #15
尝试按照 #15 (comment)
中的方式修改ldap.phpldap_auth.php


遇到的问题:

使用以下配置登录时报错 账户信息不合法。
登录使用 [email protected]
确认了账号密码无误。


日志:

[2023-10-23 11:13:08] production.INFO: User 'liuker sun' is being imported.  
[2023-10-23 11:13:08] production.INFO: User 'liuker sun' is being synchronized.  
[2023-10-23 11:13:08] production.INFO: User 'liuker sun' has been successfully synchronized.  
[2023-10-23 11:13:08] production.INFO: User 'liuker sun' is authenticating with username: '[email protected]'  
[2023-10-23 11:13:08] production.INFO: LDAP (ldap:https://myldap.server.com:389) - Connection: default - Operation: Attempting - Username: [email protected]  
[2023-10-23 11:13:08] production.INFO: LDAP (ldap:https://myldap.server.com:389) - Connection: default - Operation: Binding - Username: [email protected]  
[2023-10-23 11:13:08] production.WARNING: LDAP (ldap:https://myldap.server.com:389) - Connection: default - Operation: Failed - Username: [email protected] - Reason: Invalid DN syntax  
[2023-10-23 11:13:08] production.INFO: LDAP (ldap:https://myldap.server.com:389) - Connection: default - Operation: Binding - Username: cn=admin,dc=server,dc=net  
[2023-10-23 11:13:08] production.INFO: LDAP (ldap:https://myldap.server.com:389) - Connection: default - Operation: Bound - Username: cn=admin,dc=server,dc=net  
[2023-10-23 11:13:08] production.INFO: User 'liuker sun' has failed LDAP authentication. 

LDAP结构:
image


Dockerfile中LDAP相关配置:

ENV WIZARD_USE_LDAP=true
ENV LDAP_LOGGING=true
ENV LDAP_HOSTS=my_LDAP_server
ENV LDAP_PORT=389
ENV LDAP_BASE_DN=cn=user,ou=User,dc=example,dc=net
ENV LDAP_USERNAME=cn=admin,dc=example,dc=net
ENV LDAP_PASSWORD=LDAP_admin_password
ENV LDAP_USE_SSL=false
ENV LDAP_USE_TLS=false
ENV LDAP_PASSWORD_SYNC=true
ENV LDAP_LOGIN_FALLBACK=ture
ENV LDAP_SYNC_NAME_ATTR=mail
ENV LDAP_SCHEMA="Adldap\Schemas\OpenLDAP"
ENV LDAP_SCOPES_CLASS="Adldap\Laravel\Scopes\UidScope"
ENV LDAP_LOCATE_USERS_BY=mail
ENV LDAP_BIND_USER_BY=mail
ENV LDAP_SYNC_EMAIL_ATTR=mail
@LiukerSun
Copy link
Author

如果修改配置为:

ENV LDAP_BASE_DN=dc=example,dc=net

则报419
image

日志里是空的。

image

@LiukerSun
Copy link
Author

It has been resolved.
I've adjusted the LDAP suffix and prefix.

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

1 participant