diff --git a/src/chttpd_auth.erl b/src/chttpd_auth.erl index be12148..d4d5a42 100644 --- a/src/chttpd_auth.erl +++ b/src/chttpd_auth.erl @@ -17,6 +17,7 @@ -export([default_authentication_handler/1]). -export([cookie_authentication_handler/1]). +-export([delegated_authentication_handler/1]). -export([party_mode_handler/1]). -export([handle_session_req/1]). @@ -47,6 +48,7 @@ default_authentication_handler(Req) -> cookie_authentication_handler(Req) -> couch_httpd_auth:cookie_authentication_handler(Req, chttpd_auth_cache). + party_mode_handler(Req) -> case config:get("chttpd", "require_valid_user", "false") of "true" -> @@ -60,6 +62,9 @@ party_mode_handler(Req) -> end end. +delegated_authentication_handler(Req) -> + couch_httpd_auth:handle_delegated_session_req(Req, chttpd_auth_cache). + handle_session_req(Req) -> couch_httpd_auth:handle_session_req(Req, chttpd_auth_cache). diff --git a/src/chttpd_httpd_handlers.erl b/src/chttpd_httpd_handlers.erl index b91aae9..7e51e65 100644 --- a/src/chttpd_httpd_handlers.erl +++ b/src/chttpd_httpd_handlers.erl @@ -24,6 +24,7 @@ url_handler(<<"_reload_query_servers">>) -> fun chttpd_misc:handle_reload_query_ url_handler(<<"_replicate">>) -> fun chttpd_misc:handle_replicate_req/1; url_handler(<<"_uuids">>) -> fun chttpd_misc:handle_uuids_req/1; url_handler(<<"_session">>) -> fun chttpd_auth:handle_session_req/1; +url_handler(<<"_login_as">>) -> fun chttpd_auth:delegated_authentication_handler/1; url_handler(<<"_up">>) -> fun chttpd_misc:handle_up_req/1; url_handler(_) -> no_match.