fix(ldap): handle invalidCredentials in ldap authn

This commit is contained in:
Zaiming (Stone) Shi 2023-09-29 00:51:05 +02:00
parent 9ee2cb9c79
commit 4a4730ad46
1 changed files with 7 additions and 1 deletions

View File

@ -102,8 +102,14 @@ authenticate(
{bind, Entry#eldap_entry.object_name, Credential}
)
of
ok ->
{ok, #{result := ok}} ->
{ok, #{is_superuser => false}};
{ok, #{result := 'invalidCredentials'}} ->
?TRACE_AUTHN_PROVIDER(error, "ldap_bind_failed", #{
resource => ResourceId,
reason => 'invalidCredentials'
}),
{error, bad_username_or_password};
{error, Reason} ->
?TRACE_AUTHN_PROVIDER(error, "ldap_bind_failed", #{
resource => ResourceId,