使用jboss安全域进行LDAP身份验证

时间:2015-09-29 03:56:22

标签: authentication spring-security jboss ldap securitydomain

在JBOSS EAP 6上运行的使用spring 4.1.6,spring security 4.0.1和JavaConfig的Web应用程序中,我们尝试实现LDAP身份验证,而不是定义LDAP服务器的属性(url等)在configure(AuthenticationManagerBuilder auth)方法中,我们希望从已经在容器上配置并具有所有必需属性的JBOSS安全域获取属性。

我们尝试了几件事,并在网上搜索了实现这一目标的方法,但无法找到解决方案。

这就是我们目前所拥有的:

/WEB-INF/jboss-web.xml: 的jboss-网 安全域 Java的:/ JAAS /广告LDAP 安全域 JBoss的幅

安全配置类:

var VehicleList = React.createClass({
getInitialState: function () {
    return {
        data: [
            {
                imageUrl: '',
                carName: 'Toyota Rav 4 2013 GXL 5D 4x2',
                carDescription: '4Cyl, 2.0L, Petrol, Front Wheel Drive, Black, 39,326 KM, 1EDW426',
                location: 'WA',
                price: '28,990',
                priceDescription: 'Ex Govt Charges'
            },
            {
                imageUrl: '',
                carName: 'Toyota Camry CV50 2014 Altise 4D Sedan',
                carDescription: '4Cyl, 2.5L, Petrol, Front Wheel Drive, Silver, 6,211 KM, 1EOZ902',
                location: 'WA',
                price: '21,990',
                priceDescription: 'Ex Govt Charges'
            },
            {
                imageUrl: '',
                carName: 'Toyota 86 ZN6 2013 GTS 2D Coupe',
                carDescription: '4Cyl, 2.0L, Petrol, Rear Wheel Drive, Orange, 19,973 KM, 1AD6VE',
                location: 'VIC',
                price: '33,998',
                priceDescription: 'Drive Away No More to Pay'
            },
            {
                imageUrl: '',
                carName: 'Toyota Camry CV50 2013 Atara SX 4D Sedan',
                carDescription: '4Cyl, 2.5L, Petrol, Front Wheel Drive, Graphite, 39,381 KM, 1EHO792',
                location: 'WA',
                price: '22,888',
                priceDescription: 'Ex Govt Charges'
            },
            {
                imageUrl: '',
                carName: 'Toyota Yaris 2014 YR 5D Hatch',
                carDescription: '4Cyl, 1.3L, Petrol, Front Wheel Drive, Red, 12,130 KM, 1EOF489',
                location: 'WA',
                carPrice: '14,500',
                priceDescription: 'Ex Govt Charges'
            }

        ]
    }
},
render: function () {
    var rows = this.state.data.map(function (vehicle, i) {
        return <VehicleRow data={vehicle} key={i}/>
    })
    return <div class="container listContent">{rows}</div>
}
});

var VehicleRow = React.createClass({
render: function () {
    return <div class='row'>
        <div class='col-md-3 imageContainer'></div>
        <div class='col-md-6 carInfoContainer'>
            <div class='carName'>{this.props.data.carName}</div>
            <div>{this.props.data.carDescription}</div>
            <div><span>Location:</span><span>{this.props.data.location}</span></div>
        </div>
        <div class='col-md-3 priceInfoContainer'>
            <div>{this.props.data.price}</div>
            <div>{this.props.data.priceDescription}</div>
        </div>
    </div>

}
});

React.render(<VehicleList />, document.body);

由于

1 个答案:

答案 0 :(得分:0)

您只需在独立XML中的安全域中定义LDAP服务器URL。

http://www.mastertheboss.com/jboss-server/jboss-security/configure-jboss-with-ldap?start=1 但请注意,在上面的示例中,web.xml中的Realm name元素应为:

Column 1 | Column 2 | Column 3
abc      |  123     |   1
cde      |  23      |   2

https://docs.jboss.org/author/display/WFLY8/Examples