I can confirm this happens in PHP 8.1 and not 8.0. I can see this in the PHP error log:
#3 /.../public_html/login.php(51): AuthenticationBackend::process()
#4 {main}
thrown in phar:///.../public_html/include/plugins/auth-ldap.phar/authentication.php on line 390
[12-Dec-2022 18:01:04 UTC] PHP Fatal error: Uncaught Error: Call to a member function dn() on bool in phar:///.../public_html/include/plugins/auth-ldap.phar/authentication.php:246
Stack trace:
#0 phar:///.../public_html/include/plugins/auth-ldap.phar/authentication.php(430): LDAPAuthentication->authenticate()
#1 /.../public_html/include/class.auth.php(341): StaffLDAPAuthentication->authenticate()
#2 /.../public_html/scp/login.php(71): AuthenticationBackend::process()
#3 {main}
thrown in phar:///.../public_html/include/plugins/auth-ldap.phar/authentication.php on line 246
Additionally, this is the PHP documentation for the LDAP functions:
8.1.0 The ldap parameter expects an LDAP\Connection instance now; previously, a resource was expected.
8.1.0 Returns an LDAP\Result instance now; previously, a resource was returned.
Not sure if that has something to do with the problem.
I can see the auth-ldap plugin uses Net_LDAP2, which is not maintained anymore, and the last release was in 2015.