Class OAuth2ClientCredentialsSigningRestTemplateFactory


  • @Component
    public class OAuth2ClientCredentialsSigningRestTemplateFactory
    extends Object
    Returns a RestTemplate with OAuth 2.0 access token in its authentication header.

    If there is no cached token for this site yet, OAuth2ClientCredentialsJwtTokenService will fetch a token from Atlassian authorization server by sending the client id and secret. Otherwise, if the token exists and had not expired it can be used directly in authentication header; and if the token has expired, re-authorization will be needed.

    • Method Detail

      • getOAuth2ClientCredentialsSignedRestTemplate

        @Cacheable("oauth2-clients-client-credentials")
        public org.springframework.web.client.RestTemplate getOAuth2ClientCredentialsSignedRestTemplate()
      • getOAuth2ClientCredentialsSignedRestTemplate

        public org.springframework.web.client.RestTemplate getOAuth2ClientCredentialsSignedRestTemplate​(AtlassianHost host)
        Parameters:
        host - the host to which the request should be made
        Returns:
        RestTemplate