From 808b8c32563c9839d96927806012ee04d894989c Mon Sep 17 00:00:00 2001 From: "olivier.antoine" Date: Mon, 23 Nov 2020 21:05:32 +0100 Subject: [PATCH] Avoid ClassCastException if principalClaim value is not a String Closes gh-9212 --- .../authentication/JwtAuthenticationConverter.java | 5 +++-- .../authentication/JwtAuthenticationConverterTests.java | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/authentication/JwtAuthenticationConverter.java b/oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/authentication/JwtAuthenticationConverter.java index 1962e03aac..787c3a5fb6 100644 --- a/oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/authentication/JwtAuthenticationConverter.java +++ b/oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/authentication/JwtAuthenticationConverter.java @@ -29,6 +29,7 @@ import org.springframework.util.Assert; * @author Rob Winch * @author Josh Cummings * @author Evgeniy Cheban + * @author Olivier Antoine * @since 5.1 */ public class JwtAuthenticationConverter implements Converter { @@ -43,8 +44,8 @@ public class JwtAuthenticationConverter implements Converter