首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用JBoss <安全域>的Spring安全性

使用JBoss <安全域>的Spring安全性
EN

Stack Overflow用户
提问于 2015-01-27 13:48:01
回答 1查看 2.9K关注 0票数 2

我正在使用基于Java的@配置使用Security构建一个应用程序。我们的JBoss EAP 6服务器配置了一个安全域,该域在jboss-web.xml-File中定义。

jboss-web.xml

代码语言:javascript
复制
<!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>

有没有一种方法可以在我的Security中使用这个安全域?

Security配置

代码语言:javascript
复制
@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();
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-01-28 10:02:26

JBoss身份验证需要

代码语言:javascript
复制
org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider

该方法可以添加以下内容:

代码语言:javascript
复制
auth.authenticationProvider(...);

此外还有一个

代码语言:javascript
复制
org.springframework.security.web.authentication.preauth.j2ee.J2eePreAuthenticatedProcessingFilter 

应该注册。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28172056

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档