Class OidcIdTokenDecoderFactory
java.lang.Object
org.springframework.security.oauth2.client.oidc.authentication.OidcIdTokenDecoderFactory
- All Implemented Interfaces:
JwtDecoderFactory<ClientRegistration>
public final class OidcIdTokenDecoderFactory
extends Object
implements JwtDecoderFactory<ClientRegistration>
A
factory
that provides a JwtDecoder
used for
OidcIdToken
signature verification. The provided JwtDecoder
is
associated to a specific ClientRegistration
.- Since:
- 5.2
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateDecoder
(ClientRegistration clientRegistration) Creates aJwtDecoder
using the supplied "contextual" type.Returns the defaultConverter
's used for type conversion of claim values for anOidcIdToken
.void
setClaimTypeConverterFactory
(Function<ClientRegistration, org.springframework.core.convert.converter.Converter<Map<String, Object>, Map<String, Object>>> claimTypeConverterFactory) Sets the factory that provides aConverter
used for type conversion of claim values for anOidcIdToken
.void
setJwsAlgorithmResolver
(Function<ClientRegistration, JwsAlgorithm> jwsAlgorithmResolver) Sets the resolver that provides the expectedJWS algorithm
used for the signature or MAC on theID Token
.void
setJwtValidatorFactory
(Function<ClientRegistration, OAuth2TokenValidator<Jwt>> jwtValidatorFactory) Sets the factory that provides anOAuth2TokenValidator
, which is used by theJwtDecoder
.
-
Constructor Details
-
OidcIdTokenDecoderFactory
public OidcIdTokenDecoderFactory()
-
-
Method Details
-
createDefaultClaimTypeConverters
public static Map<String,org.springframework.core.convert.converter.Converter<Object, createDefaultClaimTypeConverters()?>> Returns the defaultConverter
's used for type conversion of claim values for anOidcIdToken
.- Returns:
- a
Map
ofConverter
's keyed byclaim name
-
createDecoder
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(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
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(Function<ClientRegistration, org.springframework.core.convert.converter.Converter<Map<String, Object>, Map<String, 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
-