春季启动+春季LDAP +服务帐户+错误凭证

问题描述:

我使用活动目录服务帐户时出现错误凭证异常,并且相同的代码对于用户帐户正常工作。春季启动+春季LDAP +服务帐户+错误凭证

服务用户凭证没有问题。

请在下面找到我的代码。

@Configuration 
protected static class AuthenticationConfiguration extends GlobalAuthenticationConfigurerAdapter { 
    @Override 
    public void init(AuthenticationManagerBuilder auth) throws Exception { 
     ActiveDirectoryLdapAuthenticationProvider provider = new ActiveDirectoryLdapAuthenticationProvider(
       "abc.def.ghi", "ldap://abc.def.ghi:389"); 
     auth.authenticationProvider(provider); 
    } 

}

的userPrincipleName属性不与预期的格式用户名@域名为特定的用户帐户内联。