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

Resuse the original user principal to avoid crumb issues. #426

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

jtnord
Copy link
Member

@jtnord jtnord commented Oct 11, 2024

as it has been observed that the case of a user may change during a refreesh flow even though they are the same user, the crumb uses the Authentications name (principal), which would be different as we use the returned value.
Rather than using the new value, after checking it is the same id (according to the ID Strategy) we use the original so that the crumb can be matched.

maybe fixes: #411

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

as it has been observed that the case of a user may change during a
refreesh flow even though they are the same user, the crumb uses the
Authentications name (principal), which would be different as we use the
returned value.
Rather than using the new value, after checking it is the same id
(according to the ID Strategy) we use the original so that the crumb can
be matched.

maybe fixes: jenkinsci#411
@jtnord jtnord requested a review from a team as a code owner October 11, 2024 13:14
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 14.28571% with 6 lines in your changes missing coverage. Please review.

Project coverage is 71.44%. Comparing base (0a76e5d) to head (0fdc550).
Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
...va/org/jenkinsci/plugins/oic/OicSecurityRealm.java 14.28% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #426      +/-   ##
============================================
- Coverage     71.68%   71.44%   -0.25%     
- Complexity      202      206       +4     
============================================
  Files            16       16              
  Lines           890      907      +17     
  Branches        120      128       +8     
============================================
+ Hits            638      648      +10     
- Misses          188      191       +3     
- Partials         64       68       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mikecirioli
Copy link
Contributor

looking forward to see if this fixes some of the annoying errors i see in my browser logs :)

@jtnord jtnord merged commit b5d5c2a into jenkinsci:master Oct 24, 2024
19 of 21 checks passed
@jtnord jtnord deleted the crumb-refresh branch October 24, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

invalid auth after 3 minutes of inactivity
2 participants