RedisTokenStore will break when upgrading spring-security-core #662
Description
We just encountered this when upgrading to Spring Boot 1.3.0.
Spring Boot 1.2.4 uses security core 3.2.7 but Spring Boot 1.3.0 has upgraded to 4.0.3.
Caused by: java.io.InvalidClassException: org.springframework.security.core.authority.SimpleGrantedAuthority; local class incompatible: stream classdesc serialVersionUID = 320, local class serialVersionUID = 400
This happens because the default serialization strategy is JdkSerializationStrategy
and SimpleGrantedAuthority
gets its serialVersionUID
from SpringSecurityCoreVersion.SERIAL_VERSION_UID
. I'm sure other objects in the tree have also had their serialVersionUID
changed from 320 to 400 as well.
I'm not sure what to do about this. I guess just a warning to users when they upgrade? We are likely going to have to flush all our token related Redis keys when we deploy our services based on Spring Boot 1.3.0.
We are also considering implementing a Kyro based serialization strategy to avoid this problem in the future.