From ee60f4ccd9cf9ac9c812c0d09a88ae6bfd729b8c Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Sat, 12 Sep 2020 19:54:32 +0200 Subject: [PATCH 1/2] tests: fix invalid YAML Somwhere while polishing the initial PR I forgot to add that colo. --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 842e4bcc..75b8b574 100644 --- a/flake.nix +++ b/flake.nix @@ -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))" From 6a07712e1d93b9af7036d49759f18c4ad75cf112 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Sat, 12 Sep 2020 19:56:46 +0200 Subject: [PATCH 2/2] LDAP: only try LDAP authentication when the realm is configured --- src/lib/Hydra/Controller/User.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/User.pm b/src/lib/Hydra/Controller/User.pm index e1351be4..656ce018 100644 --- a/src/lib/Hydra/Controller/User.pm +++ b/src/lib/Hydra/Controller/User.pm @@ -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 {