Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-587

Can't Access Groups If userPrincipalName Doesn't Exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • 1.3.3, 1.4.0-RC2
    • None
    • None

    Description

      Sometimes you need to use sAMAccountName instead of userPrincipalName in your search.
      However, this is hard-coded in a private method
      https://github.com/apache/shiro/blob/master/core/src/main/java/org/apache/shiro/realm/activedirectory/ActiveDirectoryRealm.java#L171

      See here for a similar question on stackoverflow
      http://stackoverflow.com/questions/24062383/shiro-ldap-authorization-config/34896329#34896329

      There is a similar bug in Spring Security
      https://github.com/spring-projects/spring-security/issues/2448

      Making the search query was configurable in the shiro.ini would be useful.

      Making the getRoleNamesForUser protected instead of private would make sub-classing easier.
      Or keep the method private but make a protected method that returns Object[] searchArguments.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              opticyclic opticyclic
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: