diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2010-11-19 19:54:04 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2010-11-19 19:54:04 +0000 |
commit | cfdc1c4915babc77e9a6e702363d83970d67a559 (patch) | |
tree | e9059ab7181818a812fd87594c2301b7b5aedee0 /src/rabbit_access_control.erl | |
parent | 6d8b9ac51ff4f6923d7b17fc75fbb7b54414bb70 (diff) | |
download | rabbitmq-server-cfdc1c4915babc77e9a6e702363d83970d67a559.tar.gz |
Not sure that's the right approach but at least a) EXTERNAL works via pluggable backends now and b) I've got it out of my head.
Diffstat (limited to 'src/rabbit_access_control.erl')
-rw-r--r-- | src/rabbit_access_control.erl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/rabbit_access_control.erl b/src/rabbit_access_control.erl index f419ec11..e4836370 100644 --- a/src/rabbit_access_control.erl +++ b/src/rabbit_access_control.erl @@ -33,8 +33,9 @@ -include_lib("stdlib/include/qlc.hrl"). -include("rabbit.hrl"). --export([user_pass_login/2, check_user_pass_login/2, make_salt/0, - check_password/2, check_vhost_access/2, check_resource_access/3]). +-export([user_pass_login/2, check_user_pass_login/2, check_user_login/2, + make_salt/0, check_password/2, check_vhost_access/2, + check_resource_access/3]). -export([add_user/2, delete_user/1, change_password/2, set_admin/1, clear_admin/1, list_users/0, lookup_user/1]). -export([change_password_hash/2]). @@ -109,10 +110,13 @@ user_pass_login(User, Pass) -> end. check_user_pass_login(Username, Password) -> + check_user_login(Username, [{password, Password}]). + +check_user_login(Username, AuthProps) -> {ok, Modules} = application:get_env(rabbit, auth_backends), lists:foldl( fun(Module, {refused, _}) -> - Module:check_user_pass_login(Username, Password); + Module:check_user_login(Username, AuthProps); (_, {ok, User}) -> {ok, User} end, {refused, Username}, Modules). |