Class OAuth2ClientCredentialsAuthorizedClientProvider

  • All Implemented Interfaces:
    org.springframework.security.oauth2.client.OAuth2AuthorizedClientProvider

    @Component
    public class OAuth2ClientCredentialsAuthorizedClientProvider
    extends Object
    implements org.springframework.security.oauth2.client.OAuth2AuthorizedClientProvider
    • Method Detail

      • authorize

        public org.springframework.security.oauth2.client.OAuth2AuthorizedClient authorize​(org.springframework.security.oauth2.client.OAuth2AuthorizationContext context)
        Specified by:
        authorize in interface org.springframework.security.oauth2.client.OAuth2AuthorizedClientProvider
      • getOAuth2AccessToken

        protected org.springframework.security.oauth2.core.OAuth2AccessToken getOAuth2AccessToken​(AtlassianHost host,
                                                                                                  org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration)
      • setAccessTokenResponseClient

        public void setAccessTokenResponseClient​(AtlassianOAuth2ClientCredentialsTokenResponseClient tokenResponseClient)
        Sets the client used when requesting an access token credential at the Token Endpoint.
        Parameters:
        tokenResponseClient - the client used when requesting an access token credential at the Token Endpoint
      • hasTokenExpired

        public boolean hasTokenExpired​(org.springframework.security.oauth2.core.AbstractOAuth2Token token)
      • setClockSkew

        public void setClockSkew​(Duration clockSkew)
        Sets the maximum acceptable clock skew, which is used when checking the access token expiry. The default is 60 seconds. An access token is considered expired if it's before Instant.now(this.clock) - clockSkew.
        Parameters:
        clockSkew - the maximum acceptable clock skew
      • setClock

        public void setClock​(Clock clock)
        Sets the Clock used in Instant.now(Clock) when checking the access token expiry.
        Parameters:
        clock - the clock