From b648a24f5ffb52d8955bc96c39795d28f38d6e69 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Mon, 1 Apr 2024 16:14:21 -0600 Subject: [PATCH] Polish Type Conversion API Issue gh-6245 --- .../authentication/OidcIdTokenDecoderFactory.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/oidc/authentication/OidcIdTokenDecoderFactory.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/oidc/authentication/OidcIdTokenDecoderFactory.java index fe6996aedf..cd2609a197 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/oidc/authentication/OidcIdTokenDecoderFactory.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/oidc/authentication/OidcIdTokenDecoderFactory.java @@ -78,8 +78,7 @@ public final class OidcIdTokenDecoderFactory implements JwtDecoderFactory jwtDecoders = new ConcurrentHashMap<>(); @@ -94,6 +93,17 @@ public final class OidcIdTokenDecoderFactory implements JwtDecoderFactory restOperationsFactory = ( clientRegistration) -> new RestTemplate(); + /** + * Returns the default {@link Converter}'s used for type conversion of claim values + * for an {@link OidcIdToken}. + * @return a {@link Map} of {@link Converter}'s keyed by {@link IdTokenClaimNames + * claim name} + * @since 6.3 + */ + public static ClaimTypeConverter createDefaultClaimTypeConverter() { + return new ClaimTypeConverter(createDefaultClaimTypeConverters()); + } + /** * Returns the default {@link Converter}'s used for type conversion of claim values * for an {@link OidcIdToken}.