Class NimbusJwtClientAuthenticationParametersConverter<T extends AbstractOAuth2AuthorizationGrantRequest>
- java.lang.Object
-
- org.springframework.security.oauth2.client.endpoint.NimbusJwtClientAuthenticationParametersConverter<T>
-
- Type Parameters:
T
- the type ofAbstractOAuth2AuthorizationGrantRequest
- All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<T,org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>>
public final class NimbusJwtClientAuthenticationParametersConverter<T extends AbstractOAuth2AuthorizationGrantRequest> extends java.lang.Object implements org.springframework.core.convert.converter.Converter<T,org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>>
AConverter
that customizes the OAuth 2.0 Access Token Request parameters by adding a signed JSON Web Token (JWS) to be used for client authentication at the Authorization Server's Token Endpoint. The private/secret key used for signing the JWS is supplied by thecom.nimbusds.jose.jwk.JWK
resolver provided via the constructor.NOTE: This implementation uses the Nimbus JOSE + JWT SDK.
- Since:
- 5.5
- See Also:
Converter
,JWK
,AbstractOAuth2AuthorizationGrantRequestEntityConverter.addParametersConverter(Converter)
,AbstractOAuth2AuthorizationGrantRequestEntityConverter.addParametersConverter(Converter)
, 2.2 Using JWTs for Client Authentication, 4.2 Using Assertions for Client Authentication, Nimbus JOSE + JWT SDK
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NimbusJwtClientAuthenticationParametersConverter.JwtClientAuthenticationContext<T extends AbstractOAuth2AuthorizationGrantRequest>
A context that holds client authentication-specific state and is used byNimbusJwtClientAuthenticationParametersConverter
when attempting to customize the JSON Web Token (JWS) client assertion.
-
Constructor Summary
Constructors Constructor Description NimbusJwtClientAuthenticationParametersConverter(java.util.function.Function<ClientRegistration,com.nimbusds.jose.jwk.JWK> jwkResolver)
Constructs aNimbusJwtClientAuthenticationParametersConverter
using the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>
convert(T authorizationGrantRequest)
void
setJwtClientAssertionCustomizer(java.util.function.Consumer<NimbusJwtClientAuthenticationParametersConverter.JwtClientAuthenticationContext<T>> jwtClientAssertionCustomizer)
Sets theConsumer
to be provided theNimbusJwtClientAuthenticationParametersConverter.JwtClientAuthenticationContext
, which contains theJwsHeader.Builder
andJwtClaimsSet.Builder
for further customization.
-
-
-
Constructor Detail
-
NimbusJwtClientAuthenticationParametersConverter
public NimbusJwtClientAuthenticationParametersConverter(java.util.function.Function<ClientRegistration,com.nimbusds.jose.jwk.JWK> jwkResolver)
Constructs aNimbusJwtClientAuthenticationParametersConverter
using the provided parameters.- Parameters:
jwkResolver
- the resolver that provides thecom.nimbusds.jose.jwk.JWK
associated to theclient
-
-
Method Detail
-
convert
public org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> convert(T authorizationGrantRequest)
- Specified by:
convert
in interfaceorg.springframework.core.convert.converter.Converter<T extends AbstractOAuth2AuthorizationGrantRequest,org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>>
-
setJwtClientAssertionCustomizer
public void setJwtClientAssertionCustomizer(java.util.function.Consumer<NimbusJwtClientAuthenticationParametersConverter.JwtClientAuthenticationContext<T>> jwtClientAssertionCustomizer)
Sets theConsumer
to be provided theNimbusJwtClientAuthenticationParametersConverter.JwtClientAuthenticationContext
, which contains theJwsHeader.Builder
andJwtClaimsSet.Builder
for further customization.- Parameters:
jwtClientAssertionCustomizer
- theConsumer
to be provided theNimbusJwtClientAuthenticationParametersConverter.JwtClientAuthenticationContext
- Since:
- 5.7
-
-