Skip to content

LDAP login failing on 3.10.X #1174

@areis422

Description

@areis422

Version(s) affected: 3.10.x (specifically 3.10.5 and 3.10.6)
PHP Version: 7.4.22 (didn't change between 3.9.2 and 3.10.6)

Description
With LDAP enabled and working in 3.9.2, upgrading to 3.10.X results in the following message after submitting the login:
Sorry, there was an error logging you in: Call to a member function get() on null

How to reproduce

  1. have instance running on 3.9.2 with LDAP via Active Directory enabled.
  2. Upgrade to 3.10.6
  3. Fail on login

Additional context
Log messages:

[2021-08-05 01:16:33] auth.INFO: Login attempt by 'user' was successful. {"user":"user","type":"success","extra":null} {"file":"/var/www/eventum-3.10.6/lib/eventum/class.auth.php","line":85,"class":"Auth","function":"saveLoginAttempt","memory_peak_usage":"4 MB","memory_usage":"4 MB","url":"/login.php/login.php","ip":"x.x.x.x","http_method":"POST","server":"staging.eventum.domain.tld","referrer":"https://staging.eventum.domain.tld/login.php"}
[2021-08-05 01:16:33] app.CRITICAL: Unable to instantiate auth adapter {"exception":"[object] (Error(code: 0): Call to a member function get() on null at /var/www/eventum-3.10.6/src/ServiceContainer.php:89)"} {"file":"/var/www/eventum-3.10.6/lib/eventum/class.auth.php","line":476,"class":"Auth","function":"getAuthBackend","memory_peak_usage":"2 MB","memory_usage":"2 MB","url":"/list.php","ip":"x.x.x.x","http_method":"GET","server":"staging.eventum.domain.tld","referrer":"https://staging.eventum.domain.tld/login.php"}

Auth config (from setup.php):

    'auth' => [
        'adapter' => 'Eventum\\Auth\\Adapter\\ChainAdapter',
        'options' => [
            'Eventum\\Auth\\Adapter\\MysqlAdapter' => null,
            'Eventum\\Auth\\Adapter\\ChainAdapter' => [
                [
                    'Eventum\\Auth\\Adapter\\MysqlAdapter',
                    'Eventum\\Auth\\Adapter\\LdapAdapter',
                ],
            ],
            'Eventum\\Auth\\Adapter\\LdapAdapter' => null,
        ],
        'login_backoff' => [
            'count' => null,
            'minutes' => 15,
        ],
    ],

LDAP Configuration (redacted):

    'ldap' => [
        'active_dn' => 'dc=domain,dc=tld',
        'inactive_dn' => 'ou=Disabled Users,OU=Users,OU=office,dc=domain,dc=tld',
        'default_role' => [
            1 => '6',
        ],
        'binddn' => 'user@domain.tld',
        'bindpw' => 'somepassword',
        'host' => 'domaincontroller.domain.tld',
        'port' => '636',
        'encryption' => 'ssl',
        'basedn' => 'dc=domain,dc=tld',
        'user_id_attribute' => 'sAMAccountName',
        'userdn' => 'DOMAIN\\%UID%',
        'user_filter' => '(&(sAMAccountName={username})(memberOf=CN=somegroup,OU=Roles,OU=Groups,OU=office,DC=domain,DC=tld))',
        'customer_id_attribute' => '',
        'contact_id_attribute' => '',
        'create_users' => '1',
    ],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions