Description
Summary
When you use spring-boot with devTools you get persistent servlet session out-of-the-box that is preserved across server restarts. (spring-projects/spring-boot#3530) That's all fine and dandy but the default org.springframework.security.core.session.SessionRegistryImpl
is not aware of the principal as the registerNewSession(String sessionId, Object principal)
is called ONLY during the onAuthentication
process.
Actual Behavior
SessionRegistryImpl
is not aware of restored session for principal.
Expected Behavior
SessionRegistryImpl
is populated when a session is restored from disk. Some earlier filter should register the session if not present in the registry would be something that makes most sense to me. (probably in SecurityContextPersistenceFilter.java
)
Note
The issue is solvable in user-space with a custom filter but IMO there should not be any need for that.