Class OidcIdTokenDecoderFactory
- java.lang.Object
-
- org.springframework.security.oauth2.client.oidc.authentication.OidcIdTokenDecoderFactory
-
- All Implemented Interfaces:
JwtDecoderFactory<ClientRegistration>
public final class OidcIdTokenDecoderFactory extends java.lang.Object implements JwtDecoderFactory<ClientRegistration>
Afactory
that provides aJwtDecoder
used forOidcIdToken
signature verification. The providedJwtDecoder
is associated to a specificClientRegistration
.- Since:
- 5.2
- See Also:
JwtDecoderFactory
,ClientRegistration
,OidcIdToken
-
-
Constructor Summary
Constructors Constructor Description OidcIdTokenDecoderFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JwtDecoder
createDecoder(ClientRegistration clientRegistration)
Creates aJwtDecoder
using the supplied "contextual" type.static java.util.Map<java.lang.String,org.springframework.core.convert.converter.Converter<java.lang.Object,?>>
createDefaultClaimTypeConverters()
Returns the defaultConverter
's used for type conversion of claim values for anOidcIdToken
.void
setClaimTypeConverterFactory(java.util.function.Function<ClientRegistration,org.springframework.core.convert.converter.Converter<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>>> claimTypeConverterFactory)
Sets the factory that provides aConverter
used for type conversion of claim values for anOidcIdToken
.void
setJwsAlgorithmResolver(java.util.function.Function<ClientRegistration,JwsAlgorithm> jwsAlgorithmResolver)
Sets the resolver that provides the expectedJWS algorithm
used for the signature or MAC on theID Token
.void
setJwtValidatorFactory(java.util.function.Function<ClientRegistration,OAuth2TokenValidator<Jwt>> jwtValidatorFactory)
Sets the factory that provides anOAuth2TokenValidator
, which is used by theJwtDecoder
.
-
-
-
Method Detail
-
createDefaultClaimTypeConverters
public static java.util.Map<java.lang.String,org.springframework.core.convert.converter.Converter<java.lang.Object,?>> createDefaultClaimTypeConverters()
Returns the defaultConverter
's used for type conversion of claim values for anOidcIdToken
.- Returns:
- a
Map
ofConverter
's keyed byclaim name
-
createDecoder
public JwtDecoder createDecoder(ClientRegistration clientRegistration)
Description copied from interface:JwtDecoderFactory
Creates aJwtDecoder
using the supplied "contextual" type.- Specified by:
createDecoder
in interfaceJwtDecoderFactory<ClientRegistration>
- Parameters:
clientRegistration
- the type that provides contextual information- Returns:
- a
JwtDecoder
-
setJwtValidatorFactory
public void setJwtValidatorFactory(java.util.function.Function<ClientRegistration,OAuth2TokenValidator<Jwt>> jwtValidatorFactory)
Sets the factory that provides anOAuth2TokenValidator
, which is used by theJwtDecoder
. The default composesJwtTimestampValidator
andOidcIdTokenValidator
.- Parameters:
jwtValidatorFactory
- the factory that provides anOAuth2TokenValidator
-
setJwsAlgorithmResolver
public void setJwsAlgorithmResolver(java.util.function.Function<ClientRegistration,JwsAlgorithm> jwsAlgorithmResolver)
Sets the resolver that provides the expectedJWS algorithm
used for the signature or MAC on theID Token
. The default resolves toRS256
for allclients
.- Parameters:
jwsAlgorithmResolver
- the resolver that provides the expectedJWS algorithm
for a specificclient
-
setClaimTypeConverterFactory
public void setClaimTypeConverterFactory(java.util.function.Function<ClientRegistration,org.springframework.core.convert.converter.Converter<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>>> claimTypeConverterFactory)
Sets the factory that provides aConverter
used for type conversion of claim values for anOidcIdToken
. The default isClaimTypeConverter
for allclients
.- Parameters:
claimTypeConverterFactory
- the factory that provides aConverter
used for type conversion of claim values for a specificclient
-
-