2017-08-08 314 views
0

我試圖通過LDAP帳戶進行身份驗證:LDAP身份驗證失敗:數據52E

@Configuration 
    protected static class AnnotationConfiguration extends GlobalAuthenticationConfigurerAdapter{ 

     @Override 
     public void init(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception{ 
      authenticationManagerBuilder 
       .ldapAuthentication() 
       .userSearchFilter("(cn={0})") 
       .userSearchBase("ou=User Accounts,dc=ph,dc=sunlife") 
       //.groupSearchFilter("") 
       //.userDnPatterns("cn={0},ou=Functional Accounts") 
       //.rolePrefix("") 
       .contextSource() 
       .url("ldap://ldapvs.ph.sun/dc=ph,dc=sun") 
       .managerPassword("sun_01").managerDn("cn=JPH,ou=Non Internet user,ou=Staff,ou=User Accounts"); 

     } 

    } 

輸入用戶名和密碼登錄頁面後,我得到:

14:01:32 [http-bio-8085-exec-7] UsernamePasswordAuthenticationFilter - An internal error occurred while trying to authenticate the user. 
org.springframework.security.authentication.InternalAuthenticationServiceException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A8, comment: AcceptSecurityContext error, data 52e, v1db1 

雖然我知道我的密碼和用戶名是有效的。

回答