2011-03-03 2 views
0

누구든지 ldapwhoami -U portal -h yorktown -Y PLAIN -ZZ이 잘 작동하면이 코드가 작동하지 않는 이유를 볼 수 있습니까? 내가하는 일에 상응하지 않는 것이 있습니까?openldap 서버로 자바 sasl 인증

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) 

답변

0

PLAINBindRequest에 대한 설명서가 잘못 또는 OpenLDAP를 2.4.23가 요청을 처리하는 방법에 문제가있어 어느. 서버 로그에서 u:이 서버로 전달되어 uid=u:portal,dc=example,dc=com과 같은 DN이 표시되었습니다. 일단 그것을 new PLAINBindRequest("portal", "test")으로 변경하면 효과가있었습니다.