-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Revelation Builder constructor #1527
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
Conversation
Deserialize and assemble OAuth2Authorization in a user-defined mode |
@@ -391,7 +391,7 @@ public static class Builder implements Serializable { | |||
private Map<Class<? extends OAuth2Token>, Token<?>> tokens = new HashMap<>(); | |||
private final Map<String, Object> attributes = new HashMap<>(); | |||
|
|||
protected Builder(String registeredClientId) { | |||
public Builder(String registeredClientId) { |
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.
The Builder
is not intended to be directly instantiated. The factory methods withRegisteredClient()
and from()
should be used instead.
Deserialize and assemble OAuth2Authorization in a user-defined mode
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
and RegisteredClient
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.
No description provided.