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

Added check to handle token parsing with claims without "sub". #3287

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wassafshahzad
Copy link

Description

In the oidc_introspection.py func (filter *oidcIntrospectionFilter) Request(ctx filters.FilterContext) function get value form the Claim map using sub key and then casts the value into a string, but this would panic if no sub key is present. I added a check to ensure we only cast values if sub key is present.

Linked Issue

closes #3216

Approach to solution

As describe in the following comment, I dug a bit deeper and found 2 suitable values to use if subject is not present in token. One is the Subject value in tokenContainer struct or UserInfo Struct. I decided to go with the tokenContainer struct. If this is not correct please do guide me if UserInfo Struct would be better.

…e token subjact if sub is not present in claims

Signed-off-by: wassafshahzad <[email protected]>
@wassafshahzad wassafshahzad force-pushed the fix/claim-parsing-oidc-introspection branch from 03721d1 to c7467c4 Compare October 26, 2024 11:58
@MustafaSaber MustafaSaber added the bugfix Bug fixes and patches label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Bug fixes and patches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

oidcclaimquery: better error handling for casting
2 participants