Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-764

When logging in using LDAP authentication access level is always 0.

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • None
    • Web Interface
    • Debian GNU/Linux 7 (wheezy), Observium r5164, Windows Active Directory (servers 2008, 2008 r2, 2012)

    Description

      When logging in using LDAP authentication access level is always 0.

      I have narrowed this down to auth_user_level function not being called or exiting at the if statement.

      The easiest way for me to confirm this was to add a

      print_debug(echo("auth_user_level is running"));
      

      just inside the if and enable debugging. While the rest of the LDAP debugging displayed, this never echoed to the screen, the group(s) never displayed, and the user(s) never were granted an access level higher than 0

      I have attached the sanitized ldap section of my config.php. I altered none of the lines beyond swapping domain names and passwords.

      Attachments

        1. ldap.escape.patch
          0.8 kB
        2. ldap.escape.v2.patch
          2 kB
        3. sanitized-ldap-config.php
          1 kB

        Activity

          [OBS-764] When logging in using LDAP authentication access level is always 0.

          I guess that the actual problem is that there is a backslash in there to escape a comma, but in Active directory the backslash in a LDAP filter needs to be represented by it's hex equivalent https://social.technet.microsoft.com/wiki/contents/articles/5312.active-directory-characters-to-escape.aspx#LDAP_Filters in order to match. By adding slashes, escaping, the backslash in the existing \5C it preserves the filter.

          slm4996 Solomon Seal added a comment - I guess that the actual problem is that there is a backslash in there to escape a comma, but in Active directory the backslash in a LDAP filter needs to be represented by it's hex equivalent https://social.technet.microsoft.com/wiki/contents/articles/5312.active-directory-characters-to-escape.aspx#LDAP_Filters in order to match. By adding slashes, escaping, the backslash in the existing \5C it preserves the filter.

          Just in case your curious here is the string that was the problem:
          Here is how it looks to a human

          (member=CN=Seal\, Solomon,OU=Users_FacStaff,DC=domain,DC=edu)
          

          and here is how the system was seeing it

          (member=CN=Seal\5C, Solomon,OU=Users_FacStaff,DC=domain,DC=edu)
          

          Escaping the slashes fixed it up nicely.

          slm4996 Solomon Seal added a comment - Just in case your curious here is the string that was the problem: Here is how it looks to a human (member=CN=Seal\, Solomon,OU=Users_FacStaff,DC=domain,DC=edu) and here is how the system was seeing it (member=CN=Seal\5C, Solomon,OU=Users_FacStaff,DC=domain,DC=edu) Escaping the slashes fixed it up nicely.

          Found the problem and have attached a patch, in Active Directory some backslashes needed escaped. i haven't tested this on a non windows system, but if it isn't safe enough to implement as is you could always check against the $config['auth_ldap_attr']['uid'] for sAMAccountname before you escape the slashes.

          slm4996 Solomon Seal added a comment - Found the problem and have attached a patch, in Active Directory some backslashes needed escaped. i haven't tested this on a non windows system, but if it isn't safe enough to implement as is you could always check against the $config ['auth_ldap_attr'] ['uid'] for sAMAccountname before you escape the slashes.
          slm4996 Solomon Seal added a comment - - edited

          No, same as before. When I enable debugging it never show that it is lopping through my groups. It never outputs anything ldap related to the screen upon login and I have level 0 permissions. Running r5299

          slm4996 Solomon Seal added a comment - - edited No, same as before. When I enable debugging it never show that it is lopping through my groups. It never outputs anything ldap related to the screen upon login and I have level 0 permissions. Running r5299

          Solomon, after r5275 problem solved?

          landy Mike Stupalov added a comment - Solomon, after r5275 problem solved?

          I want to reiterate that users are able to login without issue. The primary group is being checked and if removed logins fail. It is only the settings of levels that is not working.

          slm4996 Solomon Seal added a comment - I want to reiterate that users are able to login without issue. The primary group is being checked and if removed logins fail. It is only the settings of levels that is not working.

          People

            landy Mike Stupalov
            slm4996 Solomon Seal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: