Class ConfigurableOidcIdTokenDecoderFactory

  • All Implemented Interfaces:
    org.springframework.security.oauth2.jwt.JwtDecoderFactory<org.springframework.security.oauth2.client.registration.ClientRegistration>

    public final class ConfigurableOidcIdTokenDecoderFactory
    extends Object
    implements org.springframework.security.oauth2.jwt.JwtDecoderFactory<org.springframework.security.oauth2.client.registration.ClientRegistration>
    same as OidcIdTokenDecoderFactory, but so we can configure the clienthHttpRequestFactory used by NimbusJwtDecoder
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigurableOidcIdTokenDecoderFactory​(org.springframework.http.client.HttpComponentsClientHttpRequestFactory oauthHttpRequestFactory)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.security.oauth2.jwt.JwtDecoder createDecoder​(org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration)  
      static Map<String,​org.springframework.core.convert.converter.Converter<Object,​?>> createDefaultClaimTypeConverters()
      Returns the default Converter's used for type conversion of claim values for an OidcIdToken.
      void setClaimTypeConverterFactory​(Function<org.springframework.security.oauth2.client.registration.ClientRegistration,​org.springframework.core.convert.converter.Converter<Map<String,​Object>,​Map<String,​Object>>> claimTypeConverterFactory)
      Sets the factory that provides a Converter used for type conversion of claim values for an OidcIdToken.
      void setJwsAlgorithmResolver​(Function<org.springframework.security.oauth2.client.registration.ClientRegistration,​org.springframework.security.oauth2.jose.jws.JwsAlgorithm> jwsAlgorithmResolver)
      Sets the resolver that provides the expected JWS algorithm used for the signature or MAC on the ID Token.
      void setJwtValidatorFactory​(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 an OAuth2TokenValidator, which is used by the JwtDecoder.
    • Constructor Detail

      • ConfigurableOidcIdTokenDecoderFactory

        public ConfigurableOidcIdTokenDecoderFactory​(org.springframework.http.client.HttpComponentsClientHttpRequestFactory oauthHttpRequestFactory)
    • Method Detail

      • createDefaultClaimTypeConverters

        public static Map<String,​org.springframework.core.convert.converter.Converter<Object,​?>> createDefaultClaimTypeConverters()
        Returns the default Converter's used for type conversion of claim values for an OidcIdToken.
        Returns:
        a Map of Converter's keyed by claim name
      • createDecoder

        public org.springframework.security.oauth2.jwt.JwtDecoder createDecoder​(org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration)
        Specified by:
        createDecoder in interface org.springframework.security.oauth2.jwt.JwtDecoderFactory<org.springframework.security.oauth2.client.registration.ClientRegistration>
      • setJwtValidatorFactory

        public void setJwtValidatorFactory​(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 an OAuth2TokenValidator, which is used by the JwtDecoder. The default composes JwtTimestampValidator and OidcIdTokenValidator.
        Parameters:
        jwtValidatorFactory - the factory that provides an OAuth2TokenValidator
      • setJwsAlgorithmResolver

        public void setJwsAlgorithmResolver​(Function<org.springframework.security.oauth2.client.registration.ClientRegistration,​org.springframework.security.oauth2.jose.jws.JwsAlgorithm> jwsAlgorithmResolver)
        Sets the resolver that provides the expected JWS algorithm used for the signature or MAC on the ID Token. The default resolves to RS256 for all clients.
        Parameters:
        jwsAlgorithmResolver - the resolver that provides the expected JWS algorithm for a specific client
      • setClaimTypeConverterFactory

        public void setClaimTypeConverterFactory​(Function<org.springframework.security.oauth2.client.registration.ClientRegistration,​org.springframework.core.convert.converter.Converter<Map<String,​Object>,​Map<String,​Object>>> claimTypeConverterFactory)
        Sets the factory that provides a Converter used for type conversion of claim values for an OidcIdToken. The default is ClaimTypeConverter for all clients.
        Parameters:
        claimTypeConverterFactory - the factory that provides a Converter used for type conversion of claim values for a specific client