我試圖使用Spring Security提供的LDAP身份驗證。一切都很好。在部署應用程序時出現以下錯誤。Spring Security LDAP身份驗證不適用於Java 8
Caused by: java.lang.RuntimeException: Could not postProcess [email protected]efa of type class org.springframework.security.ldap.server.ApacheDSContainer
at org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor.postProcess(AutowireBeanFactoryObjectPostProcessor.java:70)
at org.springframework.security.config.annotation.SecurityConfigurerAdapter$CompositeObjectPostProcessor.postProcess(SecurityConfigurerAdapter.java:123)
at org.springframework.security.config.annotation.SecurityConfigurerAdapter.postProcess(SecurityConfigurerAdapter.java:82)
at org.springframework.security.config.annotation.authentication.configurers.ldap.LdapAuthenticationProviderConfigurer.access$400(LdapAuthenticationProviderConfigurer.java:58)
at org.springframework.security.config.annotation.authentication.configurers.ldap.LdapAuthenticationProviderConfigurer$ContextSourceBuilder.build(LdapAuthenticationProviderConfigurer.java:555)
at org.springframework.security.config.annotation.authentication.configurers.ldap.LdapAuthenticationProviderConfigurer$ContextSourceBuilder.access$500(LdapAuthenticationProviderConfigurer.java:446)
at org.springframework.security.config.annotation.authentication.configurers.ldap.LdapAuthenticationProviderConfigurer.getContextSource(LdapAuthenticationProviderConfigurer.java:606)
at org.springframework.security.config.annotation.authentication.configurers.ldap.LdapAuthenticationProviderConfigurer.build(LdapAuthenticationProviderConfigurer.java:76)
Spring核心版本是4.3.2。 Spring Security LDAP版本是4.1.1。
我的Google研究列出了2013年的一篇文章,其中說這個問題是因爲Spring Security LDAP和Java 8之間不兼容。同一篇文章說它已經在某些Spring Boot版本中得到修復。它沒有提到非Spring引導庫的任何修補程序。
有沒有人試過使用Java 8的Spring Security LDAP Authentication?請幫忙。
很多感謝你的回答像有你的LDAP設置。我想知道是否在我的情況下使用嵌入式ApacheDS LDAP服務器,即通過類路徑上的LDIF文件導致我的應用程序失敗? –