Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support ES256&ES512 alg #457

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/resty/openidc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -930,13 +930,14 @@ end
local function is_algorithm_supported(jwt_header)
return jwt_header and jwt_header.alg and (jwt_header.alg == "none"
or string.sub(jwt_header.alg, 1, 2) == "RS"
or string.sub(jwt_header.alg, 1, 2) == "ES"
or string.sub(jwt_header.alg, 1, 2) == "HS")
end

-- is the JWT signing algorithm an asymmetric one whose key might be
-- obtained from the discovery endpoint?
local function uses_asymmetric_algorithm(jwt_header)
return string.sub(jwt_header.alg, 1, 2) == "RS"
return string.sub(jwt_header.alg, 1, 2) == "RS" or string.sub(jwt_header.alg, 1, 2) == "ES"
end

-- is the JWT signing algorithm one that has been expected?
Expand Down