[ELY-2589] Make sure the delegate#setAuthorized call happens before the super#setAuthorized call for SSO to ensure the session cache has the correct information after a session ID change #2094
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://issues.redhat.com/browse/ELY-2589
https://issues.redhat.com/browse/JBEAP-25796
Description of the fix
The changes for ELY-1945 ensure that if we are associating an identity with the session for the first time then we need to change the ID of the session.
However, when the ID of the session is changed, the SSO session cache doesn't get updated accordingly. This means that the corresponding logout handling for the session won't get registered.
This PR changes the order in which
setAuthorized
gets called in CachedIdentityAuthorizationCallback#setAuthorized to ensure that the entry that gets added to the SSO session cache has the correct session ID.More details about this fix can be found here.
Tests
Note that a new test case for this fix has been added to the Elytron Web test suite, see wildfly-security/elytron-web#245.