bzp2010 commented on code in PR #11987:
URL: https://github.com/apache/apisix/pull/11987#discussion_r1980654418
##########
apisix/plugins/openid-connect.lua:
##########
@@ -547,6 +575,40 @@ function _M.rewrite(plugin_conf, ctx)
return 403, core.json.encode(error_response)
end
end
+
+ -- jwt audience claim validator
+ local audience_claim = core.table.try_read_attr(conf,
"claim_validator",
+ "audience",
"claim") or "aud"
+ local audience_value = response[audience_claim]
+ if core.table.try_read_attr(conf, "claim_validator", "audience",
"required")
+ and not audience_value then
+ core.log.error("OIDC introspection failed: required audience
(",
+ audience_claim, ") not present")
+ local error_response = { error = "required audience claim not
present" }
+ return 403, core.json.encode(error_response)
+ end
+ if core.table.try_read_attr(conf, "claim_validator", "audience",
"match_with_client_id")
+ and audience_value ~= nil then
+ local error_response = { error = "mismatched audience" }
Review Comment:
If so, should I need to set the `Content-Type: application/json` header
manually? 🤔
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]