Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-3099

management authorization throws an exception when an LDAP group contains a slash/backslash character

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 8.1.0.CR1, 8.1.0.Final
    • 8.0.0.Final
    • Management
    • None
    • Hide

      Using current build (11-mar-2014) of wildfly and Windows AD 2008R2 as the LDAP server

      • create an LDAP groups that has a slash:
        CN=slash / group,CN=Users,DC=jbossuk,DC=com
        CN=backslahs \ and / group,CN=Users,DC=jbossuk,DC=com
      • assign a user to these groups
        the user can also be assigned to other groups.
      • configure for RBAC:
        <security-realm name="ADManagementRealm">
        <authentication>
        <ldap connection="adcon" base-dn="dc=jbossuk,dc=com" recursive="true">
        <username-filter attribute="sAMAccountName"/>
        </ldap>
        </authentication>
        <authorization>
        <ldap connection="adcon">
        <group-search group-dn-attribute="dn" group-name-attribute="cn">
        <principal-to-group group-attribute="memberOf"/>
        </group-search>
        </ldap>
        </authorization>
        </security-realm>

      <management>
      <access-control provider="rbac">
      <role-mapping>
      <role name="SuperUser">
      <include>
      <user name="tom"/>
      <user name="$local"/>
      <group name="JBossAdmin"/>
      </include>
      </role>
      </role-mapping>
      </access-control>
      </management>

      Use the CLI, and login with that user:

      Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

      https://social.technet.microsoft.com/wiki/contents/articles/5312.active-directory-characters-to-escape.aspx :

      org.jboss.as.domain.management.security.LdapGroupSearcherFactory.java

      line 211 needs to be corrected like this:

      String distingushedName = groupRefValues.next().replace("
      ", "\\\\").replace("/", "
      /");

      This takes care of / and \ but also of all other escaped characters like #

      Show
      Using current build (11-mar-2014) of wildfly and Windows AD 2008R2 as the LDAP server create an LDAP groups that has a slash: CN=slash / group,CN=Users,DC=jbossuk,DC=com CN=backslahs \ and / group,CN=Users,DC=jbossuk,DC=com assign a user to these groups the user can also be assigned to other groups. configure for RBAC: <security-realm name="ADManagementRealm"> <authentication> <ldap connection="adcon" base-dn="dc=jbossuk,dc=com" recursive="true"> <username-filter attribute="sAMAccountName"/> </ldap> </authentication> <authorization> <ldap connection="adcon"> <group-search group-dn-attribute="dn" group-name-attribute="cn"> <principal-to-group group-attribute="memberOf"/> </group-search> </ldap> </authorization> </security-realm> <management> <access-control provider="rbac"> <role-mapping> <role name="SuperUser"> <include> <user name="tom"/> <user name="$local"/> <group name="JBossAdmin"/> </include> </role> </role-mapping> </access-control> </management> Use the CLI, and login with that user: Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed https://social.technet.microsoft.com/wiki/contents/articles/5312.active-directory-characters-to-escape.aspx : org.jboss.as.domain.management.security.LdapGroupSearcherFactory.java line 211 needs to be corrected like this: String distingushedName = groupRefValues.next().replace(" ", "\\\\").replace("/", " /"); This takes care of / and \ but also of all other escaped characters like #
    • Low

    Description

      management authorization throws an exception when an LDAP group contains a slash/backslash character

      Attachments

        Activity

          People

            tfonteyn Tom Fonteyne (Inactive)
            tfonteyn Tom Fonteyne (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: