-
Notifications
You must be signed in to change notification settings - Fork 90
refactor(jans-cedarling): relax JWT validation to allow optional claims #10173
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
Conversation
- Make the `iss` claim OPTIONAL. - Make the `aud` claim OPTIONAL. - Make the `sub` claim OPTIONAL. - Make the `exp` claim OPTIONAL but validate it if it exists. - Make the `nbf` claim OPTIONAL but validate it if it exists. Signed-off-by: rmarinn <34529290+rmarinn@users.noreply.github.com>
DryRun Security SummaryThe pull request focuses on improving the security of the JWT (JSON Web Token) validation process in the Expand for full summarySummary: The code changes in this pull request focus on improving the security of the JWT (JSON Web Token) validation process in the The key security-related changes include:
Overall, the changes in this pull request focus on strengthening the security of the JWT validation process, but they also introduce some potential trade-offs that should be reviewed and addressed to maintain the application's overall security posture. Files Changed:
Code AnalysisWe ran Riskiness🟢 Risk threshold not exceeded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code style looks OK to me.
Is these changes are related to cedarling validation config inputs in the Bootstrap properties ?
// `exp` by default. | ||
validator.required_spec_claims.clear(); | ||
// `aud` should be optional. | ||
validator.validate_aud = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these flags will decide if the claims are optional or mandatory. Are we setting the default value here?
And user can reset these values in the bootstrap configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a quick fix, so we can test tokens for MVP since i still haven't finished #10142.
The new bootstrop properties are not implemented yet, i just removed the overly-strict restrictions for now in case we wan't to test for MVP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me.
iss
claim OPTIONAL.aud
claim OPTIONAL.sub
claim OPTIONAL.exp
claim OPTIONAL but validate it if it exists.nbf
claim OPTIONAL but validate it if it exists.Prepare
Description
This PR relaxes the JWT validation to allow optional claims.
This following implementation will probably change after #10142 gets resolved but should be helpful for testing before MVP.
Target issue
target issue: #10060
closes #10060
Implementation Details
When performing JWT validation:
iss
claim OPTIONAL.aud
claim OPTIONAL.sub
claim OPTIONAL.exp
claim OPTIONAL but validate it if it exists.nbf
claim OPTIONAL but validate it if it exists.Test and Document the changes
Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with
docs:
to indicate documentation changes or if the below checklist is not selected.