fix(ldap-sso): do not log error level when invalid user credentials
This commit is contained in:
parent
39820be5ff
commit
b28e781c50
|
@ -131,8 +131,10 @@ login(
|
||||||
{bind, Entry#eldap_entry.object_name, Sign}
|
{bind, Entry#eldap_entry.object_name, Sign}
|
||||||
)
|
)
|
||||||
of
|
of
|
||||||
ok ->
|
{ok, #{result := ok}} ->
|
||||||
ensure_user_exists(Username);
|
ensure_user_exists(Username);
|
||||||
|
{ok, #{result := invalidCredentials} = Reason} ->
|
||||||
|
{error, Reason};
|
||||||
{error, _} = Error ->
|
{error, _} = Error ->
|
||||||
Error
|
Error
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -249,7 +249,7 @@ do_ldap_query(
|
||||||
#{pool_name := PoolName} = State
|
#{pool_name := PoolName} = State
|
||||||
) ->
|
) ->
|
||||||
LogMeta = #{connector => InstId, search => SearchOptions, state => emqx_utils:redact(State)},
|
LogMeta = #{connector => InstId, search => SearchOptions, state => emqx_utils:redact(State)},
|
||||||
?TRACE("QUERY", "ldap_connector_received", LogMeta),
|
?TRACE("QUERY", "ldap_connector_received_query", LogMeta),
|
||||||
case
|
case
|
||||||
ecpool:pick_and_do(
|
ecpool:pick_and_do(
|
||||||
PoolName,
|
PoolName,
|
||||||
|
|
|
@ -80,7 +80,9 @@ on_query(
|
||||||
ldap_connector_query_return,
|
ldap_connector_query_return,
|
||||||
#{result => ok}
|
#{result => ok}
|
||||||
),
|
),
|
||||||
ok;
|
{ok, #{result => ok}};
|
||||||
|
{error, invalidCredentials} ->
|
||||||
|
{ok, #{result => invalidCredentials}};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
?SLOG(
|
?SLOG(
|
||||||
error,
|
error,
|
||||||
|
|
Loading…
Reference in New Issue