feat(openid-connect): add consumer selector for consumer-group realm routing#13038
feat(openid-connect): add consumer selector for consumer-group realm routing#13038PiyushMishra318 wants to merge 1 commit intoapache:masterfrom
Conversation
|
Thanks in advance for reviewing this PR. I’m happy to iterate on the implementation based on maintainer feedback, including behavior changes, API/schema adjustments, additional tests, or splitting this into smaller PRs if that is preferred. |
Baoyuantop
left a comment
There was a problem hiding this comment.
A better approach is to directly support multiple Issuer configurations (valid_issuers + multiple discovery) within the openid-connect plugin, instead of distributing routes via "unsigned JWT Claims". Consider supporting multiple Issuer configurations directly within the openid-connect plugin (each issuer corresponds to a set of discovery/client_id/client_secret), which is a more secure and concise solution, eliminating the need for routing before signature verification.
This PR adds an optional
consumer_selectorcapability to theopenid-connectplugin, allowing a single route to select a Consumer (and Consumer Group) from a JWT claim (for example,iss) before OIDC validation.With this flow, APISIX can apply realm-specific
openid-connectconfigurations from Consumer Groups deterministically on one route, without requiringkey-authpre-resolution.Changes included:
consumer_selectorschema fields inopenid-connect:enabledclaim(defaultiss)map(claim value -> consumer name)strictopenid-connectconfigX-Userinfo)consumer.get_consumer(name)helper and safe local-cache cloning inconsumer.luat/plugin/openid-connect2.tdocs/en/latest/plugins/openid-connect.mdWhich issue(s) this PR fixes:
Fixes #13037
Checklist