summaryrefslogtreecommitdiff
path: root/src/ejabberd_auth.erl
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2011-08-16 00:26:49 +0200
committerBadlop <badlop@process-one.net>2011-08-16 00:26:49 +0200
commit1ee6eae684c126b486c70a3cadd58fa282f517ad (patch)
tree9e15e7960fa6d3ca0b90fcf3e23ba158bf2d6535 /src/ejabberd_auth.erl
parentIndicate license and copyright (thanks to Stephen Röttger)(EJAB-1196) (diff)
Fix and improve support for SCRAM auth method (EJAB-1196)
Diffstat (limited to 'src/ejabberd_auth.erl')
-rw-r--r--src/ejabberd_auth.erl15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl
index d937340f..1eab9af8 100644
--- a/src/ejabberd_auth.erl
+++ b/src/ejabberd_auth.erl
@@ -50,7 +50,7 @@
remove_user/2,
remove_user/3,
plain_password_required/1,
- storage_type/1,
+ store_type/1,
entropy/1
]).
@@ -70,25 +70,26 @@ start() ->
end, auth_modules(Host))
end, ?MYHOSTS).
+%% This is only executed by ejabberd_c2s for non-SASL auth client
plain_password_required(Server) ->
lists:any(
fun(M) ->
M:plain_password_required()
end, auth_modules(Server)).
-storage_type(Server) ->
+store_type(Server) ->
lists:foldl(
fun(_, external) ->
external;
(M, scram) ->
- case M:storage_type() of
+ case M:store_type() of
external ->
external;
_Else ->
scram
end;
(M, plain) ->
- M:storage_type()
+ M:store_type()
end, plain, auth_modules(Server)).
%% @doc Check if the user and password can login in server.
@@ -248,8 +249,10 @@ get_password_s(User, Server) ->
case get_password(User, Server) of
false ->
"";
- Password ->
- Password
+ Password when is_list(Password) ->
+ Password;
+ _ ->
+ ""
end.
%% @doc Get the password of the user and the auth module.