Minor refactoring of OIDC DefaultTokenStateManager #45302
Merged
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.
This PR is the first preparation PR for addressing #32109 (and #45093).
Let me clarify. OIDC DefaultTokenStateManager, by default, stores 3 tokens, ID, access, and refresh tokens as an encrypted cookie value:
ID token | access token | refresh token
But there are variations: storing the access and refresh tokens is optional , and also if token values are huge, each of these tokens can be represented by an individual cookie.
As far as #32109 is concerned, storing an additional property becomes very hard.
So this PR starts with restructuring a bit the way OIDC DefaultTokenStateManager currently deals with storing tokens in cookies and getting them out of cookies, and adds quite a few comments to make it clearer what is going on.
Not a single piece of logic has changed
.I did it so that it could be easier to follow the changes in the planned second preparation PR, where tokens will be stored in JSON, which will make it much easier to deal with multiple tokens and some extra properties.
Also, FYI, @pedroigor @michalvavrik