-
Notifications
You must be signed in to change notification settings - Fork 6k
UsernamePasswordAuthenticationTokenDeserializer doesn't deserialize details to correct type #7482
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
Comments
@buzzerrookie Is there a reason why you are only registering these specific modules?
Please take a look at the Spring Security Jackson documentation. |
@eleftherias |
@buzzerrookie Can you please provide a minimal sample that reproduces this issue? |
@eleftherias I uploaded a minimal sample project as follows. |
@eleftherias Hi,I also meet the same problem as @buzzerrookie does.And I have try to do as what you say, but it doesn't work. I am using |
@eleftherias I do as https://github.com/spring-projects/spring-session/tree/2.2.0.RELEASE/spring-session-samples/spring-session-sample-boot-redis-json) . Then it throws an new exception. |
@chokPeng You issue appears to be different. |
@eleftherias Can you reproduce this issue with my sample project ? |
@buzzerrookie Yes, thank you for providing the sample. |
@eleftherias I have pushed another commit to branch gh-7482. Could you please have a look to see whether it is ok? Thank you. |
Before this commit, the details field was set to a JsonNode, but now it is deserialized correctly. Fixes gh-7482
UsernamePasswordAuthenticationTokenDeserializer doesn't deserialize details to correct type
When using Spring Security and Spring Session with GenericJackson2JsonRedisSerializer, UsernamePasswordAuthenticationTokenDeserializer deserializes the details field of UsernamePasswordAuthenticationToken as a JsonNode, not the original Object such as WebAuthenticationDetails.
Actual Behavior
the details field of UsernamePasswordAuthenticationToken is deserialized as a com.fasterxml.jackson.databind.node.ObjectNode.
Expected Behavior
the details field of UsernamePasswordAuthenticationToken should be deserialized as a object of type @ class.
Configuration
I replace the default JdkSerializationRedisSerializer with GenericJackson2JsonRedisSerializer.
Version
I'm using Spring Security 4.2.2, but I also find the same issue in master branch.
Sample
The relevant code is as follows, and I add some comments in it.
the following code works.
The text was updated successfully, but these errors were encountered: