Skip to content

bug(spring-session-mongo) HttpSessionRequestCache tries to deserialize SPRING_SECURITY_SAVED_REQUEST but fails #686

Closed
@leon

Description

@leon

When using spring-session-mongo I've using spring security and a UserDetails Service which should be persisted into the session.

I'm currently getting multiple problems when trying to deserialize the session.

java.util.LinkedHashMap cannot be cast to org.springframework.security.web.savedrequest.SavedRequest

caused by

HttpSessionRequestCache

on line 71, where it tries to cast the deserialized map into a SavedRequest

I've written a couple of test where you can try it out.
https://github.com/leon/spring-session/blob/mongo-cannot-handle-saved-request/spring-session/src/test/java/org/springframework/session/data/mongo/JacksonMongoSessionConverterTest.java#L92

I then have the same problem with the UserDetails class which gets serialized as the principal.

Am I doing something wrong, or is this a bug / feature that is missing?

Metadata

Metadata

Assignees

Labels

for: stack-overflowA question that's better suited to stackoverflow.com

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions