Skip to content

Commit 5b8d818

Browse files
committed
Add serialVersionUID
This commit gives a serialVersionUID to the private adapter class for the Jwt authentication principal. It also adds a SuppressWarnings annotation so that it doesn't get picked up by config's serialization tests. This is needed since the test cannot construct a serialization sample for a private class Issue gh-6237 Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
1 parent 16b5df4 commit 5b8d818

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/authentication/JwtAuthenticationConverter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.security.oauth2.server.resource.authentication;
1818

19+
import java.io.Serial;
1920
import java.util.Collection;
2021
import java.util.HashSet;
2122
import java.util.List;
@@ -89,8 +90,12 @@ public void setPrincipalClaimName(String principalClaimName) {
8990
this.jwtPrincipalConverter = (jwt) -> new JwtAuthenticatedPrincipal(jwt, principalClaimName);
9091
}
9192

93+
@SuppressWarnings("serial") // suppress warnings in serialization tests
9294
private static final class JwtAuthenticatedPrincipal extends Jwt implements OAuth2AuthenticatedPrincipal {
9395

96+
@Serial
97+
private static final long serialVersionUID = 2236855178032591277L;
98+
9499
private final String principalClaimName;
95100

96101
JwtAuthenticatedPrincipal(Jwt jwt) {

0 commit comments

Comments
 (0)