jenkinsci / oic-auth-plugin

A Jenkins plugin which lets you login to Jenkins using your own, self-hosted or public openid connect server.
https://plugins.jenkins.io/oic-auth
MIT License
71 stars 88 forks source link

Stop persisting OicSession in HTTP session when only OIDC state is required #353

Closed Vlatombe closed 1 month ago

Vlatombe commented 1 month ago

In a CloudBees CI HA setup, I recently upgraded to 4.297.vcddb_d8a_e4694 (including #310). The various changes to OicSecurityRealm broke serialization due to usage of an anonymous inner class (extending OicSession) that gets stored in session.

Storing OicSession in session is actually only required for a brief amount of time, only between doCommenceLogin and doFinishLogin. Once the user is logged in, it is no longer necessary to store the whole object. The only thing that needs to be persisted is the state, as it gets used later for logging out.

Testing done

Submitter checklist

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.02%. Comparing base (bca3705) to head (b7205f1). Report is 14 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #353 +/- ## ============================================ - Coverage 72.46% 72.02% -0.45% - Complexity 201 234 +33 ============================================ Files 9 11 +2 Lines 839 990 +151 Branches 119 142 +23 ============================================ + Hits 608 713 +105 - Misses 170 199 +29 - Partials 61 78 +17 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.