简体   繁体   中英

Migrating “Security Domain” from JBoss 5.1.0 to WildFly

I am migrating a JBoss 5.1.0 app to WildFly 8.1.0. On my jboss-web.xml I have the following element:

<security-domain>java:/jaas/myApp</security-domain>

However, the schma http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd does not support this element, causing:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'security-domain'.

The security domain is related to this application policy:

<application-policy name="myApp">
    <authentication>
        <login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required">
            <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory/module-option>
            <module-option name="java.naming.provider.url">ldap://example.com:389</module-option>
            <module-option name="java.naming.security.authentication">simple</module-option>
            <module-option name="bindDN">"DOMAIN"\username</module-option>
            <module-option name="bindCredential">credential</module-option>
            <module-option name="baseCtxDN">OU=aaaaa,OU=bbbbb,DC=cccc,DC=dddd,DC=com,DC=br</module-option>
            <module-option name="baseFilter">(sAMAccountName={0})</module-option>
            <module-option name="rolesCtxDN">OU=aaaaa,OU=bbbbb,DC=cccc,DC=dddd,DC=com,DC=br</module-option>
            <module-option name="roleFilter">(member={1})</module-option>
            <module-option name="roleAttributeIsDN">true</module-option>
            <module-option name="roleNameAttributeID">cn</module-option>
            <module-option name="searchTimeLimit">30000</module-option>
            <module-option name="searchScope">SUBTREE_SCOPE</module-option>
            <module-option name="allowEmptyPasswords">false</module-option>
        </login-module>
    </authentication>
</application-policy>

How can I rewrite this to make my app "WildFly deployable".

Two issues I can see:

  1. In WildFly 8 security domains no longer use the prefix java:/jaas/ in their names. Remove this prefix from the security domain configurations in jboss-web.xml for web applications and jboss.xml for enterprise applications.

  2. You need to set your LdapExtLoginModule in a security-domain. Here you will find the LDAP setup in the developer guide (migrating from AS5/AS6) https://docs.jboss.org/author/display/WFLY8/How+do+I+migrate+my+application+from+AS5+or+AS6+to+WildFly#HowdoImigratemyapplicationfromAS5orAS6toWildFly-ConfigureLDAPsecurityrealmchanges

There is more information in the guide for migrating your jboss AS5/AS6 application to wildfly in case you run into more issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM