summaryrefslogtreecommitdiff
path: root/src/couch/src/couch_httpd_auth.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couch/src/couch_httpd_auth.erl')
-rw-r--r--src/couch/src/couch_httpd_auth.erl6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/couch/src/couch_httpd_auth.erl b/src/couch/src/couch_httpd_auth.erl
index 43fb4161c..4f19728e9 100644
--- a/src/couch/src/couch_httpd_auth.erl
+++ b/src/couch/src/couch_httpd_auth.erl
@@ -192,8 +192,7 @@ jwt_authentication_handler(Req) ->
case header_value(Req, "Authorization") of
"Bearer " ++ Jwt ->
RequiredClaims = get_configured_claims(),
- AllowedAlgorithms = get_configured_algorithms(),
- case jwtf:decode(?l2b(Jwt), [{alg, AllowedAlgorithms} | RequiredClaims], fun jwtf_keystore:get/2) of
+ case jwtf:decode(?l2b(Jwt), [alg | RequiredClaims], fun jwtf_keystore:get/2) of
{ok, {Claims}} ->
case lists:keyfind(<<"sub">>, 1, Claims) of
false -> throw({unauthorized, <<"Token missing sub claim.">>});
@@ -208,9 +207,6 @@ jwt_authentication_handler(Req) ->
_ -> Req
end.
-get_configured_algorithms() ->
- re:split(config:get("jwt_auth", "allowed_algorithms", "HS256"), "\s*,\s*", [{return, binary}]).
-
get_configured_claims() ->
re:split(config:get("jwt_auth", "required_claims", ""), "\s*,\s*", [{return, binary}]).