spring-security-oauth2 saves the Authentication
object as part of the access token entry in the database as a serialized java object (ByteArrayOutputStream.writeObject(authentication)
).
How do you handle version upgrades of either spring-security (which may change the SpringSecurityCoreVersion.SERIAL_VERSION_UID) and spring-security-oauth (which may change the serialVersionUID of the OAuth2Authentication
)? If the serialVersionUID changes, the persisted Authentication object cannot be deserialized anymore.
We are coming to the conclusion that deleting the access tokens containing the serialized Authentication objects would be the cleanest and easiest solution when upgrading the framework version. Any ideas how to handle this more gracefully?