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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leshalv
The
Builder
is not intended to be directly instantiated. The factory methodswithRegisteredClient()
andfrom()
should be used instead.I don't quite understand this statement. Please provide more specific details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When customizing redis storage, deserialization is required. RegisteredClient is required to build an OAuth2Authorization object, which requires encapsulation of RegisteredClient. In fact, when building OAuth2Authorization, only registeredClientId is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leshalv
OAuth2Authorization
andRegisteredClient
are core domain classes within the framework and are not intended to represent an Entity or DTO, that can more easily be serialized. If you're looking to serialize these objects into a Redis store then you need to create an Entity/DTO representation of those objects so it can be serialized.There is a discussion and some examples provided in gh-558.
We are also planning on providing a How-to guide in gh-1019 to demonstrate how to implement it. You can also look at the existing How-to: Implement core services with JPA to see how the Entity representations can look like and instead of persisting to a sql db, you can serialize to JSON for Redis storage.
I'm going to close this PR as we don't want to expose the
Builder
constructor as the factory methods should be used instead.