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

Ability to validate claims in JWT policy #6829

Open
anderius opened this issue Nov 19, 2024 · 4 comments
Open

Ability to validate claims in JWT policy #6829

anderius opened this issue Nov 19, 2024 · 4 comments
Labels
proposal An issue that proposes a feature request ready for refinement An issue that was triaged and it is ready to be refined
Milestone

Comments

@anderius
Copy link

Currently, we must use snippets to validate claims in the validated JWT.

It would be very nice if we could validate custom claims, for example scope, directly from the JWT policy (https://docs.nginx.com/nginx-ingress-controller/configuration/policy-resource/#jwt-using-jwks-from-remote-location).

As an example of how this cane be done, see https://learn.microsoft.com/en-us/azure/api-management/validate-jwt-policy.

From that link (of course I don't want XML, but you get the idea :-) ):

 <required-claims>
    <claim name="name of the claim as it appears in the token" match="all | any" separator="separator character in a multi-valued claim">
      <value>claim value as it is expected to appear in the token</value>
      <!-- if there is more than one allowed value, then add additional value elements -->
    </claim>
    <!-- if there are multiple possible allowed claim, then add additional claim elements -->
  </required-claims>
@anderius anderius added the proposal An issue that proposes a feature request label Nov 19, 2024
Copy link

Hi @anderius thanks for reporting!

Be sure to check out the docs and the Contributing Guidelines while you wait for a human to take a look at this 🙂

Cheers!

@jasonwilliams14
Copy link
Contributor

@anderius I believe this is what you are looking for? This capability in NGINX Ingress controller:

#4417

@anderius
Copy link
Author

Thank you, I was not aware of that discussion. Would you prefer to have feature requests there instead of issues?

A few points:

  • The routing is not something I need (just to clarify this request)
  • I could not understand the example, the prototype policy, but if the functionality is like in this feature request, all is good

@shaun-nx shaun-nx moved this from Todo ☑ to Prioritized backlog in NGINX Ingress Controller Nov 27, 2024
@shaun-nx
Copy link
Contributor

Hi @anderius I've added this issue as a child issues for #6565 since this it likely work that will need to come as part of this effort

@shaun-nx shaun-nx added this to the v4.1.0 milestone Nov 27, 2024
@shaun-nx shaun-nx added the ready for refinement An issue that was triaged and it is ready to be refined label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal An issue that proposes a feature request ready for refinement An issue that was triaged and it is ready to be refined
Projects
Status: Prioritized backlog
Development

No branches or pull requests

3 participants