Merge pull request #11486 from lafirest/fix/ldap_autn_wrong_pw
fix(ldap): Return correct reason code when password is wrong
This commit is contained in:
commit
7b8a599d17
|
@ -251,7 +251,7 @@ verify_password(Algorithm, LDAPPasswordType, LDAPPassword, Salt, Position, Passw
|
||||||
true ->
|
true ->
|
||||||
{ok, is_superuser(Entry, State)};
|
{ok, is_superuser(Entry, State)};
|
||||||
_ ->
|
_ ->
|
||||||
{error, invalid_password}
|
{error, bad_username_or_password}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
is_superuser(Entry, #{is_superuser_attribute := Attr} = _State) ->
|
is_superuser(Entry, #{is_superuser_attribute := Attr} = _State) ->
|
||||||
|
|
|
@ -237,7 +237,7 @@ user_seeds() ->
|
||||||
%% Not exists
|
%% Not exists
|
||||||
New(<<"notexists">>, <<"notexists">>, {error, not_authorized}),
|
New(<<"notexists">>, <<"notexists">>, {error, not_authorized}),
|
||||||
%% Wrong Password
|
%% Wrong Password
|
||||||
New(<<"mqttuser0001">>, <<"wrongpassword">>, {error, invalid_password}),
|
New(<<"mqttuser0001">>, <<"wrongpassword">>, {error, bad_username_or_password}),
|
||||||
%% Disabled
|
%% Disabled
|
||||||
New(<<"mqttuser0006">>, <<"mqttuser0006">>, {error, user_disabled}),
|
New(<<"mqttuser0006">>, <<"mqttuser0006">>, {error, user_disabled}),
|
||||||
%% IsSuperuser
|
%% IsSuperuser
|
||||||
|
|
Loading…
Reference in New Issue