Class OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder
- java.lang.Object
-
- org.springframework.security.oauth2.client.OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder
-
- Enclosing class:
- OAuth2AuthorizedClientProviderBuilder
public final class OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder extends java.lang.Object
A builder for theclient_credentials
grant.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder
accessTokenResponseClient(OAuth2AccessTokenResponseClient<OAuth2ClientCredentialsGrantRequest> accessTokenResponseClient)
Sets the client used when requesting an access token credential at the Token Endpoint.OAuth2AuthorizedClientProvider
build()
Builds an instance ofClientCredentialsOAuth2AuthorizedClientProvider
.OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder
clock(java.time.Clock clock)
Sets theClock
used inInstant.now(Clock)
when checking the access token expiry.OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder
clockSkew(java.time.Duration clockSkew)
Sets the maximum acceptable clock skew, which is used when checking the access token expiry.
-
-
-
Method Detail
-
accessTokenResponseClient
public OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder accessTokenResponseClient(OAuth2AccessTokenResponseClient<OAuth2ClientCredentialsGrantRequest> accessTokenResponseClient)
Sets the client used when requesting an access token credential at the Token Endpoint.- Parameters:
accessTokenResponseClient
- the client used when requesting an access token credential at the Token Endpoint- Returns:
- the
OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder
-
clockSkew
public OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder clockSkew(java.time.Duration clockSkew)
Sets the maximum acceptable clock skew, which is used when checking the access token expiry. An access token is considered expired if it's beforeInstant.now(this.clock) - clockSkew
.- Parameters:
clockSkew
- the maximum acceptable clock skew- Returns:
- the
OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder
-
clock
public OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder clock(java.time.Clock clock)
Sets theClock
used inInstant.now(Clock)
when checking the access token expiry.- Parameters:
clock
- the clock- Returns:
- the
OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder
-
build
public OAuth2AuthorizedClientProvider build()
Builds an instance ofClientCredentialsOAuth2AuthorizedClientProvider
.- Returns:
- the
ClientCredentialsOAuth2AuthorizedClientProvider
-
-