diff --git a/apps/emqttd/src/emqttd_http.erl b/apps/emqttd/src/emqttd_http.erl index 889bc10a9..3983cd3e8 100644 --- a/apps/emqttd/src/emqttd_http.erl +++ b/apps/emqttd/src/emqttd_http.erl @@ -77,7 +77,14 @@ authorized(Req) -> undefined -> false; "Basic " ++ BasicAuth -> - emqttd_auth:check(user_passwd(BasicAuth)) + {Username, Password} = user_passwd(BasicAuth), + case emqttd_auth:login(#mqtt_client{username = Username}, Password) of + ok -> + true; + {error, Reason} -> + lager:error("HTTP Auth failure: username=~s, reason=~p", [Username, Reason]), + false + end end. user_passwd(BasicAuth) ->