Class OAuth2ClientCredentialsSigningRestTemplateFactory
- java.lang.Object
-
- com.atlassian.connect.spring.internal.request.oauth2.OAuth2ClientCredentialsSigningRestTemplateFactory
-
@Component public class OAuth2ClientCredentialsSigningRestTemplateFactory extends Object
Returns aRestTemplate
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.
-
-
Constructor Summary
Constructors Constructor Description OAuth2ClientCredentialsSigningRestTemplateFactory(AtlassianHostUriResolver hostUriResolver, AtlassianConnectSecurityContextHelper securityContextHelper, OAuth2ClientCredentialsTokenService tokenService, UserAgentProvider userAgentProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.web.client.RestTemplate
getOAuth2ClientCredentialsSignedRestTemplate()
org.springframework.web.client.RestTemplate
getOAuth2ClientCredentialsSignedRestTemplate(AtlassianHost host)
-
-
-
Constructor Detail
-
OAuth2ClientCredentialsSigningRestTemplateFactory
@Autowired public OAuth2ClientCredentialsSigningRestTemplateFactory(AtlassianHostUriResolver hostUriResolver, AtlassianConnectSecurityContextHelper securityContextHelper, OAuth2ClientCredentialsTokenService tokenService, UserAgentProvider userAgentProvider)
-
-
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
-
-