2011-03-03 26 views
0

ldapwhoami -U portal -h yorktown -Y PLAIN -ZZがうまく動作しても、このコードが動作しない理由が分かりますか?私がやっていることは同等ではないのですか?openldapサーバを使ったjava sasl認証

 
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) 

答えて

0

PLAINBindRequestのドキュメントが間違っているまたはOpenLDAP 2.4.23が要求を処理する方法に何か問題があります次のいずれかの

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呼び出しによってスローされる次の例外を提供します。サーバーのログでは、u:がサーバーに渡されていたため、DNはuid=u:portal,dc=example,dc=comとなりました。私がnew PLAINBindRequest("portal", "test")に変更すると、それはうまくいった。

関連する問題