这是我唯一的配置类:
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled=true, jsr250Enabled=true)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.userSearchBase("cn=users,cn=accounts")
.userSearchFilter("uid={0}")
.contextSource()
.url("ldap://1.2.3.4/dc=dev");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
// TODO: fix frontend
http.csrf().disable();
}
}
我没有其他配置类或注释。我的application.properties
只设置server.port
和一些日志记录级别。如果我注释掉ldap代码并使用,例如inMemoryAuthentication
,那么一切正常。
我已经尝试过使用.ldapAuthentication()
在线我可以找到的每个例子,包括这里的一些相关问题,并且它们都会导致此错误。有什么问题?
我相信所有相关的依赖都来自这些方面:
compile 'org.springframework.boot:spring-boot-starter-security'
compile 'org.springframework.boot:spring-boot-starter-web'
堆栈跟踪的一小部分:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
...
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
...
Caused by: org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:44)
...
答案 0 :(得分:0)
添加<?php
echo $_GET['Confirm']; //Get value of the choosen 'Confirm' input
?>
将按照Ali的建议解决。