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

@Component public class DocumentsApis extends Object
Builds the documents client generated from the resource server's contract on top of a REST client that sends the access token of an authorized client (so the generated client's own authentication settings stay unused).
  • Field Details

    • restClientBuilder

      private final org.springframework.web.client.RestClient.Builder restClientBuilder
      Template of the REST clients; it is never used itself, only copied (the builder is a prototype bean).
    • properties

      private final ResourceServerProperties properties
      Where the resource server is.
    • requestFactories

      private final SslRequestFactories requestFactories
      Request factory over the SSL bundle, when there is one.
    • interceptors

      private final ResourceServerInterceptors interceptors
      Interceptors that obtain and send the access token.
  • Constructor Details

    • DocumentsApis

      public DocumentsApis()
  • Method Details

    • forPrincipal

      public DocumentsApi forPrincipal(String registrationId, org.springframework.security.core.Authentication principal)
      Builds a documents client whose requests carry the access token of one authorized client.
      Parameters:
      registrationId - registration of the OAuth2 client that obtains the token.
      principal - principal the token is cached under (the service client, or a user for a token exchange).
      Returns:
      the documents client.