Simple:身份验证类型为Simple认证。 SASL:身份验证类型为简单认证与安全层(Simple Authentication and Security Layer)。 绑定DN 客户端发起连接请求与LDAP服务器建立会话,这一过程被称为绑定。当LDAP服务器不允许匿名访问时,需要指定绑定DN,该绑定DN用于查询目录服务器,必须具备管理员权限。
env.put(Context.PROVIDER_URL, CON_URL); env.put(Context.SECURITY_AUTHENTICATION, SECURITY_AUTHENTICATION_SIMPLE); env.put(TIMEOUT, TIMEOUT_VALUE);// 连接超时设置为2秒 //env.put(Context.SECURITY_PRINCIPAL, EMAIL_SUBFIX + username); env.put(Context.SECURITY_PRINCIPAL, username); env.put(Context...
To avoid exposing the password in this way, you can use the simple authentication mechanism within an encrypted channel (such as SSL), provided that this is supported by the LDAP server. Both the LDAP v2 and v3 support simple authentication. To use the simple authentication mechanism, you ...
Myers, J., "Simple Authentication and Security Layer (SASL)", RFC 2222, October 1997. Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. Leach, P. and C. Newman, "Using Digest Authentication as a SASL Mechanism", RFC 2831, May ...
“none”: use no authentication (anonymous). “simple”: use weak authentication (password in clear text). sasl_mech: use strong authentication with SASL (Simple Authentication and Security Layer). 参考:http://www.codejava.net/coding/connecting-to-ldap-server-using-jndi-in-java ...
如果MongoDB 服务器目前强制执行身份验证,则必须以具有角色管理权限(如userAdmin或userAdminAnyDatabase提供的权限)的用户身份验证admin数据库。为 MongoDB 服务器配置的身份验证机制纳入适当的--authenticationMechanism。 mongosh --host <hostname> --port <port> --username <user> --password <pass> --authentica...
(Context.SECURITY_AUTHENTICATION,"simple");// 用户的完整 DNStringuserDN="cn="+username+","+baseDN;env.put(Context.SECURITY_PRINCIPAL,userDN);env.put(Context.SECURITY_CREDENTIALS,password);try{// 尝试连接 LDAP 服务器DirectoryContextcontext=newInitialDirContext(env);context.close();returntrue;//...
Context.SECURITY_AUTHENTICATION ("java.naming.security.authentication"): 指定要使用的认证机制。对于 JDK 中的 LDAP 服务提供者,这可以是以下字符串之一:"none", "simple", sasl_mech,其中 sasl_mech 是 SASL 机制名称的空格分隔列表。请参见认证机制部分以了解这些字符串的描述。 Context.SECURITY_PRINCIPAL (...
ThePortsetting refers to the TCP/IP port number on which the server is processing LDAP requests. Typically, this is port 389 forSimplebinds or 636 forSimple over SSLbinds. Search Credentials LDAP Authentication uses two different methods to authenticate the user. ...
(Context.PROVIDER_URL, "ldap://localhost:389/o=JNDITutorial"); // Authenticate as S. User and password "mysecret" env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, "cn=S. User, ou=NewHires, o=JNDITutorial"); env.put(Context.SECURITY_CREDENTIALS, "...