0
任何人都可以看到任何原因此代碼不起作用當ldapwhoami -U portal -h yorktown -Y PLAIN -ZZ
工作正常嗎?有沒有我做的事情是不相同的?java sasl身份驗證與openldap服務器
LDAPConnection connection = new LDAPConnection();
connection.connect("yorktown.example.com", 389);
SSLUtil sslUtil = new SSLUtil(new TrustAllTrustManager());
SSLContext sslContext = sslUtil.createSSLContext();
ExtendedResult extendedResult = connection.processExtendedOperation(new StartTLSExtendedRequest(sslContext));
PLAINBindRequest bindRequest = new PLAINBindRequest("u:portal", "test");
BindResult bindResult = connection.bind(bindRequest);
這個代碼給出了以下異常由connection.bind
調用拋出:
play.exceptions.JavaExecutionException: SASL(-13): user not found: Password verification failed at play.mvc.ActionInvoker.invoke(ActionInvoker.java:285) at Invocation.HTTP Request(Play!) Caused by: LDAPException(resultCode=49 (invalid credentials), errorMessage='SASL(-13): user not found: Password verification failed', diagnosticMessage='SASL(-13): user not found: Password verification failed') at com.unboundid.ldap.sdk.LDAPConnection.bind(LDAPConnection.java:1710)