如何通过经过身份验证的连接验证 LDAP 用户名和密码?
How to verify LDAP username and password via an authenticated connection?
目前我有1位用户有权限绑定OpenDJ服务器。然后我需要验证最终用户的用户名和密码。我怎样才能做到这一点?
这是我创建 LDAP 连接并成功绑定的方式:
LdapConnection connection = new LdapConnection("opendj.mydn.com.vn");
//Set session options
connection.SessionOptions.SecureSocketLayer = false;
connection.AuthType = AuthType.Basic;
connection.Bind(new NetworkCredential("myuser", "mypassword"));
之后,我需要使用这个连接来验证"user1"
和"password1"
。
如何查询这个动作?
这是OpenDJ的配置:
Host_LDAP=opendj.mydn.com.vn
dn_LDAP=ou\=People,dc\=mydn,dc\=com
#uid_LDAP=uid\=webservice,ou\=People,dc\=mydn,dc\=com
uid_LDAP=webservice
admin_LDAP_verify_attr=uid
admin_LDAP_verify_dn=ou\=People,dc\=mydn,dc\=com
你已经做到了。如果绑定成功,则用户名和密码正确。
编辑 您的 'IT guy' 被严重误导了。根据OpenDJ configuration documentation #6.1.5,没有真正的'bind'权限。相反:
Bind
Because this is used to establish the user's identity and derived authorizations, ACI is irrelevant for this operation and is not checked. To prevent authentication, disable the account instead. For details see Section 11.2, "Managing Accounts Manually".
[已强调。]
目前我有1位用户有权限绑定OpenDJ服务器。然后我需要验证最终用户的用户名和密码。我怎样才能做到这一点?
这是我创建 LDAP 连接并成功绑定的方式:
LdapConnection connection = new LdapConnection("opendj.mydn.com.vn");
//Set session options
connection.SessionOptions.SecureSocketLayer = false;
connection.AuthType = AuthType.Basic;
connection.Bind(new NetworkCredential("myuser", "mypassword"));
之后,我需要使用这个连接来验证"user1"
和"password1"
。
如何查询这个动作?
这是OpenDJ的配置:
Host_LDAP=opendj.mydn.com.vn
dn_LDAP=ou\=People,dc\=mydn,dc\=com
#uid_LDAP=uid\=webservice,ou\=People,dc\=mydn,dc\=com
uid_LDAP=webservice
admin_LDAP_verify_attr=uid
admin_LDAP_verify_dn=ou\=People,dc\=mydn,dc\=com
你已经做到了。如果绑定成功,则用户名和密码正确。
编辑 您的 'IT guy' 被严重误导了。根据OpenDJ configuration documentation #6.1.5,没有真正的'bind'权限。相反:
Bind
Because this is used to establish the user's identity and derived authorizations, ACI is irrelevant for this operation and is not checked. To prevent authentication, disable the account instead. For details see Section 11.2, "Managing Accounts Manually".
[已强调。]