You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OidcIdToken cannot be serialized to JSON if token contains claim of type JSONArray or JSONObject
ObjectToListStringConverter and ObjectToMapStringObjectConverter were checking if the source object is of type List or Map and if the first element or key is a String. If we have a JSONArray containing Strings the above check will pass, meaning that a JSONArray will be returned which is not serializable (same applies to JSONObject)
With this change, even if the check is passing a new List or Map will be returned.
Closesgh-9210
Copy file name to clipboardExpand all lines: oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/converter/ObjectToListStringConverter.java
-6
Original file line number
Diff line number
Diff line change
@@ -56,12 +56,6 @@ public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor t
56
56
if (source == null) {
57
57
returnnull;
58
58
}
59
-
if (sourceinstanceofList) {
60
-
List<?> sourceList = (List<?>) source;
61
-
if (!sourceList.isEmpty() && sourceList.get(0) instanceofString) {
Copy file name to clipboardExpand all lines: oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/converter/ObjectToMapStringObjectConverter.java
-3
Original file line number
Diff line number
Diff line change
@@ -52,9 +52,6 @@ public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor t
52
52
returnnull;
53
53
}
54
54
Map<?, ?> sourceMap = (Map<?, ?>) source;
55
-
if (!sourceMap.isEmpty() && sourceMap.keySet().iterator().next() instanceofString) {
Copy file name to clipboardExpand all lines: oauth2/oauth2-core/src/test/java/org/springframework/security/oauth2/core/converter/ClaimConversionServiceTests.java
Copy file name to clipboardExpand all lines: oauth2/oauth2-core/src/test/java/org/springframework/security/oauth2/core/converter/ClaimTypeConverterTests.java
0 commit comments