UnknownContentTypeException
is not Serializable
#31283
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
In Spring Security, when there is an
AuthenticationException
, there are someAuthenticationFailureHandler
implementations that save that exception as a session attribute for future use if needed.Spring Session uses, by default, the JDK mechanism to serialize the Session attributes.
In a scenario where the
user-info-uri
does not return the expected Content-Type (application/json
), theRestOperations
throws aUnknownContentTypeException
that is handled by Spring Security and transformed into anAuthenticationException
.The problem is, when Spring Session tries to serialize the
UnknownContentTypeException
it fails because thetype
property inside it is not serializable.A simple test can verify the behavior:
Is that expected that the exception cannot be serialized?
The text was updated successfully, but these errors were encountered: