Skip to content

Commit 156fc29

Browse files
buzzerrookieeleftherias
authored andcommitted
Deserialize details field in UsernamePasswordAuthenticationToken
Before this commit, the details field was set to a JsonNode, but now it is deserialized correctly. Fixes gh-7482
1 parent af41594 commit 156fc29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/java/org/springframework/security/jackson2/UsernamePasswordAuthenticationTokenDeserializer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ public UsernamePasswordAuthenticationToken deserialize(JsonParser jp, Deserializ
8787
if (detailsNode.isNull() || detailsNode.isMissingNode()) {
8888
token.setDetails(null);
8989
} else {
90-
token.setDetails(detailsNode);
90+
Object details = mapper.readValue(detailsNode.toString(), new TypeReference<Object>() {});
91+
token.setDetails(details);
9192
}
9293
return token;
9394
}

0 commit comments

Comments
 (0)