mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Fix authentication for usernames containing uppercase characters
Applies to authentication methods that compare User (normalized) and AuthzId (was not being normalized). These are external, ldap & pam. Fixes #2280
This commit is contained in:
parent
22d76659c0
commit
4f8af723c6
@ -230,19 +230,22 @@ check_password_with_authmodule(User, AuthzId, Server, Password) ->
|
||||
check_password_with_authmodule(User, AuthzId, Server, Password, Digest, DigestGen) ->
|
||||
case validate_credentials(User, Server) of
|
||||
{ok, LUser, LServer} ->
|
||||
case jid:nodeprep(AuthzId) of
|
||||
error ->
|
||||
false;
|
||||
LAuthzId ->
|
||||
lists:foldl(
|
||||
fun(Mod, false) ->
|
||||
case db_check_password(
|
||||
LUser, AuthzId, LServer, Password,
|
||||
LUser, LAuthzId, LServer, Password,
|
||||
Digest, DigestGen, Mod) of
|
||||
true -> {true, Mod};
|
||||
false -> false
|
||||
end;
|
||||
(_, Acc) ->
|
||||
Acc
|
||||
end, false, auth_modules(LServer));
|
||||
_ ->
|
||||
false
|
||||
end, false, auth_modules(LServer))
|
||||
end
|
||||
end.
|
||||
|
||||
-spec set_password(binary(), binary(), password()) -> ok | {error, atom()}.
|
||||
|
Loading…
Reference in New Issue
Block a user