私はアクティブディレクトリと春のセキュリティで新しくなっています。実際には私の春のセキュリティコンフィグレーションを変更してauthenticifcationでアクティブなディレクトリを使用したいのでSecurityConfigで使用します:LDAP:エラーコード34 - 不正なDNが指定されています
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(activeDirectoryLdapAuthenticationProvider());
auth.eraseCredentials(false);
}
@Bean
public AuthenticationProvider activeDirectoryLdapAuthenticationProvider() {
ActiveDirectoryLdapAuthenticationProvider authenticationProvider = new ActiveDirectoryLdapAuthenticationProvider(
"dc=example,dc=com", "ldap://localhost:10389/dc=example,dc=com");
authenticationProvider.setConvertSubErrorCodesToExceptions(true);
authenticationProvider.setUseAuthenticationRequestCredentials(true);
authenticationProvider.setUserDetailsContextMapper(mapper);
return authenticationProvider;
}
とアクティブなディレクトリスタジオ私にはパーティションdc=example,dc=com
があり、エントリはou=people
です。
私はこのエラーを持っているユーザー名とパスワードを入れしようとすると:
javax.naming.InvalidNameException: [LDAP: error code 34 - Incorrect DN given : [email protected]=example,dc=com (0x73 0x79 0x73 0x61 0x64 0x6D 0x69 0x6E 0x40 0x64 0x63 0x3D 0x70 0x75 0x70 0x70 0x75 0x74 0x2C 0x64 0x63 0x3D 0x63 0x6F 0x6D) is invalid] at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3076) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2883) at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2797)..
はあなたにどんな考えをしてくださいがありますか?
build.xmlファイルに「"」がないことを確認してください – Archmede