【发布时间】:2015-03-26 03:51:33
【问题描述】:
我正在使用 Spring Security 和基于 Java 的 @Configuration 构建应用程序。我们的 JBoss EAP 6 服务器配置了一个 security-domain,它在 jboss-web.xml-File 中定义。
jboss-web.xml
<!DOCTYPE jboss-web PUBLIC
"-//JBoss//DTD Web Application 4.2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
<jboss-web>
<security-domain>ldapcomponent</security-domain>
</jboss-web>
有没有办法在我的 Spring Security WebSecurityConfigurerAdapter 中使用这个 security-domain?
Spring Security Java 配置
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(securedEnabled = true)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.?????
}
@Override
protected void configure(final HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().authenticated()
.anyRequest().hasRole("my-required-role").and().httpBasic();
}
}
【问题讨论】:
标签: spring authentication jboss spring-security ldap