25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-10 15:47:30 +01:00

Make anonymous auth not override sasl mechaninsm offered by other modules

This stop overriding store_type when anonymous is enabled with other
auth modules, we don't really need that since anonymous is not taking
passwords anyway, and this was disabling scram mechanisms.

This fixes issue #2803.
This commit is contained in:
Paweł Chmielowski 2020-12-14 16:42:14 +01:00
parent a9ed26e484
commit d8d9ef32ad

View File

@ -197,16 +197,21 @@ plain_password_required(Server) ->
-spec store_type(binary()) -> plain | scram | external. -spec store_type(binary()) -> plain | scram | external.
store_type(Server) -> store_type(Server) ->
lists:foldl( case auth_modules(Server) of
fun(_, external) -> external; [ejabberd_auth_anonymous] -> external;
(M, scram) -> Modules ->
case M:store_type(Server) of lists:foldl(
external -> external; fun(ejabberd_auth_anonymous, Type) -> Type;
_ -> scram (_, external) -> external;
end; (M, scram) ->
(M, plain) -> case M:store_type(Server) of
M:store_type(Server) external -> external;
end, plain, auth_modules(Server)). _ -> scram
end;
(M, plain) ->
M:store_type(Server)
end, plain, Modules)
end.
-spec check_password(binary(), binary(), binary(), binary()) -> boolean(). -spec check_password(binary(), binary(), binary(), binary()) -> boolean().
check_password(User, AuthzId, Server, Password) -> check_password(User, AuthzId, Server, Password) ->