diff --git a/apps/emqx_management/src/emqx_mgmt_http.erl b/apps/emqx_management/src/emqx_mgmt_http.erl index 178e4b04d..aae681fd5 100644 --- a/apps/emqx_management/src/emqx_mgmt_http.erl +++ b/apps/emqx_management/src/emqx_mgmt_http.erl @@ -101,10 +101,10 @@ authorize_appid(Req) -> {basic, AppId, AppSecret} -> case emqx_mgmt_auth:is_authorized(AppId, AppSecret) of true -> ok; - false -> {401} + false -> {401, #{<<"WWW-Authenticate">> => <<"Basic Realm=\"minirest-server\"">>}, <<"UNAUTHORIZED">>} end; _ -> - {401} + {401, #{<<"WWW-Authenticate">> => <<"Basic Realm=\"minirest-server\"">>}, <<"UNAUTHORIZED">>} end. format(Port) when is_integer(Port) ->