-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Support array claims in jwt claim_to_headers #30072
Comments
CC @TAOXUY |
Also, please, pass json objects as is: Sample Zitadel decoded JWT:
Envoy config: providers:
provider_name:
issuer: https://example.com
claim_to_headers:
- header_name: x-jwt-claim-sub
claim_name: sub # works
- header_name: x-jwt-claim-role
claim_name: urn:zitadel:iam:org:project:roles.webmaster.234723879451425215 # works
- header_name: x-jwt-claim-roles
claim_name: urn:zitadel:iam:org:project:roles # NOT works, but expected {"webmaster": {"234723879451425215":"example-dev.sso.dev.example.com"} Can also help with that case? |
Agreed, this original request was for an array claim of primitives, but probably the real request would be to pass these claims through verbatim as a json string if they aren't in the currently supported data types, rather than dropping the claim. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions. |
Title: Support array claims in jwt claim_to_headers
Description:
Currently, envoy supports taking claims from an authenticated jwt, and converting them to headers that are passed to upstream services. This is a useful utility as it allows the jwt parsing & validation to be a concern of Envoy only, and upstream services can rely on the headers they receive as being validated.
However, there is a limitation cited in the documentation (and confirmed with testing):
This feature request is to remove this limitation, and support array claims.
Use-case: it is quite common to put the jwt claim "scopes" as an array claim (e.g. https://developer.okta.com/docs/reference/api/oidc/#reserved-claims-in-the-header-section has claim
scp
as an array of strings)Technical considerations
It would need to be worked out how exactly to handle array claim types. My suggestion would be to include the raw json value verbatim, and not care about the data type.
e.g. a jwt containing json field
"scopes": ["foo", "bar"],
with the following envoy configshould be inserted as header value
Relevant Links:
The text was updated successfully, but these errors were encountered: