Merge pull request #808 from andir/ldap

ldap: only try the LDAP realm when it is configured
This commit is contained in:
Eelco Dolstra 2020-09-14 15:33:33 +02:00 committed by GitHub
commit 733bbc131d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -425,7 +425,7 @@
binddn: "cn=root,dc=example"
bindpw: notapassword
start_tls: 0
start_tls_options
start_tls_options:
verify: none
user_basedn: "ou=users,dc=example"
user_filter: "(&(objectClass=inetOrgPerson)(cn=%s))"

View file

@ -29,7 +29,7 @@ sub login_POST {
error($c, "You must specify a user name.") if $username eq "";
error($c, "You must specify a password.") if $password eq "";
if ($c->authenticate({username => $username, password => $password}, 'ldap')) {
if ($c->get_auth_realm('ldap') && $c->authenticate({username => $username, password => $password}, 'ldap')) {
doLDAPLogin($self, $c, $username);
} elsif ($c->authenticate({username => $username, password => $password})) {}
else {