I think the best solution is to throw out tokens. Next to the SpringSecurityCoreVersion.SERIAL_VERSION_UID
expression there is a big comment that states:
Indeed, they deliberately beat SERIAL_VERSION_UID
(at least) with every minor release.
(The problem comments for SEC-1709 explain how they arrived at this solution.)
From the comments, I realized that if you really tried to transparently handle the version update, this can lead to a breakdown, which can lead to unpredictable consequences. (This is the "code" for possible security issues.)
OAuth2Authentication.serialVersionUID
, on the other hand, does not seem to have changed over the past 9 years.
source share