Class OAuth2AuthorizedClientProviderBuilder
java.lang.Object
org.springframework.security.oauth2.client.OAuth2AuthorizedClientProviderBuilder
A builder that builds a 
DelegatingOAuth2AuthorizedClientProvider composed of
 one or more OAuth2AuthorizedClientProvider(s) that implement specific
 authorization grants. The supported authorization grants are
 authorization_code, refresh_token,
 client_credentials and password. In
 addition to the standard authorization grants, an implementation of an extension grant
 may be supplied via provider(OAuth2AuthorizedClientProvider).- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionfinal classA builder for theauthorization_codegrant.final classA builder for theclient_credentialsgrant.final classA builder for thepasswordgrant.final classA builder for therefresh_tokengrant.
- 
Method SummaryModifier and TypeMethodDescriptionConfigures support for theauthorization_codegrant.build()Builds an instance ofDelegatingOAuth2AuthorizedClientProvidercomposed of one or moreOAuth2AuthorizedClientProvider(s).builder()Returns a newOAuth2AuthorizedClientProviderBuilderfor configuring the supported authorization grant(s).Configures support for theclient_credentialsgrant.clientCredentials(Consumer<OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder> builderConsumer) Configures support for theclient_credentialsgrant.password()Deprecated, for removal: This API element is subject to removal in a future version.The OAuth 2.0 Security Best Current Practice disallows the use of the Resource Owner Password Credentials grant.password(Consumer<OAuth2AuthorizedClientProviderBuilder.PasswordGrantBuilder> builderConsumer) Deprecated, for removal: This API element is subject to removal in a future version.The OAuth 2.0 Security Best Current Practice disallows the use of the Resource Owner Password Credentials grant.provider(OAuth2AuthorizedClientProvider provider) Configures anOAuth2AuthorizedClientProviderto be composed with theDelegatingOAuth2AuthorizedClientProvider.Configures support for therefresh_tokengrant.refreshToken(Consumer<OAuth2AuthorizedClientProviderBuilder.RefreshTokenGrantBuilder> builderConsumer) Configures support for therefresh_tokengrant.
- 
Method Details- 
builderReturns a newOAuth2AuthorizedClientProviderBuilderfor configuring the supported authorization grant(s).- Returns:
- the OAuth2AuthorizedClientProviderBuilder
 
- 
providerConfigures anOAuth2AuthorizedClientProviderto be composed with theDelegatingOAuth2AuthorizedClientProvider. This may be used for implementations of extension authorization grants.- Returns:
- the OAuth2AuthorizedClientProviderBuilder
 
- 
authorizationCodeConfigures support for theauthorization_codegrant.- Returns:
- the OAuth2AuthorizedClientProviderBuilder
 
- 
refreshTokenConfigures support for therefresh_tokengrant.- Returns:
- the OAuth2AuthorizedClientProviderBuilder
 
- 
refreshTokenpublic OAuth2AuthorizedClientProviderBuilder refreshToken(Consumer<OAuth2AuthorizedClientProviderBuilder.RefreshTokenGrantBuilder> builderConsumer) Configures support for therefresh_tokengrant.- Parameters:
- builderConsumer- a- Consumerof- OAuth2AuthorizedClientProviderBuilder.RefreshTokenGrantBuilderused for further configuration
- Returns:
- the OAuth2AuthorizedClientProviderBuilder
 
- 
clientCredentialsConfigures support for theclient_credentialsgrant.- Returns:
- the OAuth2AuthorizedClientProviderBuilder
 
- 
clientCredentialspublic OAuth2AuthorizedClientProviderBuilder clientCredentials(Consumer<OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder> builderConsumer) Configures support for theclient_credentialsgrant.- Parameters:
- builderConsumer- a- Consumerof- OAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilderused for further configuration
- Returns:
- the OAuth2AuthorizedClientProviderBuilder
 
- 
passwordDeprecated, for removal: This API element is subject to removal in a future version.The OAuth 2.0 Security Best Current Practice disallows the use of the Resource Owner Password Credentials grant. See reference OAuth 2.0 Security Best Current Practice.Configures support for thepasswordgrant.- Returns:
- the OAuth2AuthorizedClientProviderBuilder
 
- 
password@Deprecated(since="5.8", forRemoval=true) public OAuth2AuthorizedClientProviderBuilder password(Consumer<OAuth2AuthorizedClientProviderBuilder.PasswordGrantBuilder> builderConsumer) Deprecated, for removal: This API element is subject to removal in a future version.The OAuth 2.0 Security Best Current Practice disallows the use of the Resource Owner Password Credentials grant. See reference OAuth 2.0 Security Best Current Practice.Configures support for thepasswordgrant.- Parameters:
- builderConsumer- a- Consumerof- OAuth2AuthorizedClientProviderBuilder.PasswordGrantBuilderused for further configuration
- Returns:
- the OAuth2AuthorizedClientProviderBuilder
 
- 
buildBuilds an instance ofDelegatingOAuth2AuthorizedClientProvidercomposed of one or moreOAuth2AuthorizedClientProvider(s).- Returns:
- the DelegatingOAuth2AuthorizedClientProvider
 
 
-