Class CustomOidcIdTokenDecoderFactory
- java.lang.Object
-
- com.xebialabs.platform.sso.oidc.authentication.CustomOidcIdTokenDecoderFactory
-
- All Implemented Interfaces:
org.springframework.security.oauth2.jwt.JwtDecoderFactory<org.springframework.security.oauth2.client.registration.ClientRegistration>
public class CustomOidcIdTokenDecoderFactory extends java.lang.Object implements org.springframework.security.oauth2.jwt.JwtDecoderFactory<org.springframework.security.oauth2.client.registration.ClientRegistration>This class is replica ofOidcIdTokenDecoderFactorywith support for custom rest operations. This should be removed once https://github.com/spring-projects/spring-security/issues/8882 is resolved
-
-
Constructor Summary
Constructors Constructor Description CustomOidcIdTokenDecoderFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.oauth2.jwt.JwtDecodercreateDecoder(org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration)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.voidsetClaimTypeConverterFactory(java.util.function.Function<org.springframework.security.oauth2.client.registration.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 aConverterused for type conversion of claim values for anOidcIdToken.voidsetJwsAlgorithmResolver(java.util.function.Function<org.springframework.security.oauth2.client.registration.ClientRegistration,org.springframework.security.oauth2.jose.jws.JwsAlgorithm> jwsAlgorithmResolver)Sets the resolver that provides the expectedJWS algorithmused for the signature or MAC on theID Token.voidsetJwtValidatorFactory(java.util.function.Function<org.springframework.security.oauth2.client.registration.ClientRegistration,org.springframework.security.oauth2.core.OAuth2TokenValidator<org.springframework.security.oauth2.jwt.Jwt>> jwtValidatorFactory)Sets the factory that provides anOAuth2TokenValidator, which is used by theJwtDecoder.voidsetRestOperations(org.springframework.web.client.RestOperations restOperations)Sets the rest operations used to fetch keys for jwt
-
-
-
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
MapofConverter's keyed byclaim name
-
createDecoder
public org.springframework.security.oauth2.jwt.JwtDecoder createDecoder(org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration)
- Specified by:
createDecoderin interfaceorg.springframework.security.oauth2.jwt.JwtDecoderFactory<org.springframework.security.oauth2.client.registration.ClientRegistration>
-
setJwtValidatorFactory
public void setJwtValidatorFactory(java.util.function.Function<org.springframework.security.oauth2.client.registration.ClientRegistration,org.springframework.security.oauth2.core.OAuth2TokenValidator<org.springframework.security.oauth2.jwt.Jwt>> jwtValidatorFactory)
Sets the factory that provides anOAuth2TokenValidator, which is used by theJwtDecoder. The default composesJwtTimestampValidatorandOidcIdTokenValidator.- Parameters:
jwtValidatorFactory- the factory that provides anOAuth2TokenValidator
-
setJwsAlgorithmResolver
public void setJwsAlgorithmResolver(java.util.function.Function<org.springframework.security.oauth2.client.registration.ClientRegistration,org.springframework.security.oauth2.jose.jws.JwsAlgorithm> jwsAlgorithmResolver)
Sets the resolver that provides the expectedJWS algorithmused for the signature or MAC on theID Token. The default resolves toRS256for allclients.- Parameters:
jwsAlgorithmResolver- the resolver that provides the expectedJWS algorithmfor a specificclient
-
setClaimTypeConverterFactory
public void setClaimTypeConverterFactory(java.util.function.Function<org.springframework.security.oauth2.client.registration.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 aConverterused for type conversion of claim values for anOidcIdToken. The default isClaimTypeConverterfor allclients.- Parameters:
claimTypeConverterFactory- the factory that provides aConverterused for type conversion of claim values for a specificclient
-
setRestOperations
public void setRestOperations(org.springframework.web.client.RestOperations restOperations)
Sets the rest operations used to fetch keys for jwt- Parameters:
restOperations- the rest template
-
-