Class TokenEndpointClients
java.lang.Object
com.irurueta.authserver.serviceclient.infrastructure.resourceserver.TokenEndpointClients
Builds the clients of the token endpoint for the two grants, set up for the configured authentication method: the
default for
client_secret_basic; the signed assertion for private_key_jwt; a REST client over the
SSL bundle (so the client certificate is presented) for the mutual TLS methods; plus a DPoP proof header when DPoP
is enabled.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.beans.factory.ObjectProvider<DPoPProofs> Creates the DPoP proofs; absent unless DPoP is enabled.private final PrivateKeyJwkResolverSigning key of the assertion.private final ServiceClientAuthPropertiesSettings of the service client at the authorization server.private final SslRequestFactoriesRequest factory that presents the client certificate. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.oauth2.client.endpoint.RestClientClientCredentialsTokenResponseClientBuilds the client of the client credentials grant.private <T extends org.springframework.security.oauth2.client.endpoint.AbstractOAuth2AuthorizationGrantRequest>
voidcustomize(org.springframework.security.oauth2.client.endpoint.AbstractRestClientOAuth2AccessTokenResponseClient<T> client) Sets a token response client up for the configured authentication method.org.springframework.security.oauth2.client.endpoint.RestClientTokenExchangeTokenResponseClientBuilds the client of the token exchange grant.private static org.springframework.web.client.RestClienttokenRestClient(org.springframework.http.client.ClientHttpRequestFactory factory) Builds the REST client of the token endpoint over a request factory, with the message converters and the error handler of Spring Security's default one.
-
Field Details
-
properties
Settings of the service client at the authorization server. -
jwkResolver
Signing key of the assertion. -
requestFactories
Request factory that presents the client certificate. -
dpopProofs
Creates the DPoP proofs; absent unless DPoP is enabled.
-
-
Constructor Details
-
TokenEndpointClients
public TokenEndpointClients()
-
-
Method Details
-
clientCredentials
public org.springframework.security.oauth2.client.endpoint.RestClientClientCredentialsTokenResponseClient clientCredentials()Builds the client of the client credentials grant.- Returns:
- the client.
-
tokenExchange
public org.springframework.security.oauth2.client.endpoint.RestClientTokenExchangeTokenResponseClient tokenExchange()Builds the client of the token exchange grant.- Returns:
- the client.
-
customize
private <T extends org.springframework.security.oauth2.client.endpoint.AbstractOAuth2AuthorizationGrantRequest> void customize(org.springframework.security.oauth2.client.endpoint.AbstractRestClientOAuth2AccessTokenResponseClient<T> client) Sets a token response client up for the configured authentication method.- Type Parameters:
T- grant request of the client.- Parameters:
client- the client.
-
tokenRestClient
private static org.springframework.web.client.RestClient tokenRestClient(org.springframework.http.client.ClientHttpRequestFactory factory) Builds the REST client of the token endpoint over a request factory, with the message converters and the error handler of Spring Security's default one.- Parameters:
factory- the request factory.- Returns:
- the REST client.
-