java.lang.Object
com.irurueta.authserver.serviceclient.infrastructure.resourceserver.TokenEndpointClients

@Component public class TokenEndpointClients extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    private final org.springframework.beans.factory.ObjectProvider<DPoPProofs>
    Creates the DPoP proofs; absent unless DPoP is enabled.
    private final PrivateKeyJwkResolver
    Signing key of the assertion.
    Settings of the service client at the authorization server.
    private final SslRequestFactories
    Request factory that presents the client certificate.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.oauth2.client.endpoint.RestClientClientCredentialsTokenResponseClient
    Builds the client of the client credentials grant.
    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.
    org.springframework.security.oauth2.client.endpoint.RestClientTokenExchangeTokenResponseClient
    Builds the client of the token exchange grant.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • properties

      private final ServiceClientAuthProperties properties
      Settings of the service client at the authorization server.
    • jwkResolver

      private final PrivateKeyJwkResolver jwkResolver
      Signing key of the assertion.
    • requestFactories

      private final SslRequestFactories requestFactories
      Request factory that presents the client certificate.
    • dpopProofs

      private final org.springframework.beans.factory.ObjectProvider<DPoPProofs> 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.