Class ReactiveOAuth2AuthorizedClientProviderBuilder
java.lang.Object
org.springframework.security.oauth2.client.ReactiveOAuth2AuthorizedClientProviderBuilder
A builder that builds a
DelegatingReactiveOAuth2AuthorizedClientProvider
composed of one or more ReactiveOAuth2AuthorizedClientProvider(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(ReactiveOAuth2AuthorizedClientProvider).- Since:
- 5.2
- See Also:
-
Nested Class Summary
Nested 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 Summary
Modifier and TypeMethodDescriptionConfigures support for theauthorization_codegrant.build()Builds an instance ofDelegatingReactiveOAuth2AuthorizedClientProvidercomposed of one or moreReactiveOAuth2AuthorizedClientProvider(s).builder()Returns a newReactiveOAuth2AuthorizedClientProviderBuilderfor configuring the supported authorization grant(s).Configures support for theclient_credentialsgrant.clientCredentials(Consumer<ReactiveOAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder> builderConsumer) Configures support for theclient_credentialsgrant.password()Deprecated.The latest OAuth 2.0 Security Best Current Practice disallows the use of the Resource Owner Password Credentials grant.password(Consumer<ReactiveOAuth2AuthorizedClientProviderBuilder.PasswordGrantBuilder> builderConsumer) Deprecated.The latest OAuth 2.0 Security Best Current Practice disallows the use of the Resource Owner Password Credentials grant.Configures aReactiveOAuth2AuthorizedClientProviderto be composed with theDelegatingReactiveOAuth2AuthorizedClientProvider.Configures support for therefresh_tokengrant.refreshToken(Consumer<ReactiveOAuth2AuthorizedClientProviderBuilder.RefreshTokenGrantBuilder> builderConsumer) Configures support for therefresh_tokengrant.
-
Method Details
-
builder
Returns a newReactiveOAuth2AuthorizedClientProviderBuilderfor configuring the supported authorization grant(s).- Returns:
- the
ReactiveOAuth2AuthorizedClientProviderBuilder
-
provider
public ReactiveOAuth2AuthorizedClientProviderBuilder provider(ReactiveOAuth2AuthorizedClientProvider provider) Configures aReactiveOAuth2AuthorizedClientProviderto be composed with theDelegatingReactiveOAuth2AuthorizedClientProvider. This may be used for implementations of extension authorization grants.- Returns:
- the
ReactiveOAuth2AuthorizedClientProviderBuilder
-
authorizationCode
Configures support for theauthorization_codegrant.- Returns:
- the
ReactiveOAuth2AuthorizedClientProviderBuilder
-
refreshToken
Configures support for therefresh_tokengrant.- Returns:
- the
ReactiveOAuth2AuthorizedClientProviderBuilder
-
refreshToken
public ReactiveOAuth2AuthorizedClientProviderBuilder refreshToken(Consumer<ReactiveOAuth2AuthorizedClientProviderBuilder.RefreshTokenGrantBuilder> builderConsumer) Configures support for therefresh_tokengrant.- Parameters:
builderConsumer- aConsumerofReactiveOAuth2AuthorizedClientProviderBuilder.RefreshTokenGrantBuilderused for further configuration- Returns:
- the
ReactiveOAuth2AuthorizedClientProviderBuilder
-
clientCredentials
Configures support for theclient_credentialsgrant.- Returns:
- the
ReactiveOAuth2AuthorizedClientProviderBuilder
-
clientCredentials
public ReactiveOAuth2AuthorizedClientProviderBuilder clientCredentials(Consumer<ReactiveOAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilder> builderConsumer) Configures support for theclient_credentialsgrant.- Parameters:
builderConsumer- aConsumerofReactiveOAuth2AuthorizedClientProviderBuilder.ClientCredentialsGrantBuilderused for further configuration- Returns:
- the
ReactiveOAuth2AuthorizedClientProviderBuilder
-
password
Deprecated.The latest 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
ReactiveOAuth2AuthorizedClientProviderBuilder
-
password
@Deprecated public ReactiveOAuth2AuthorizedClientProviderBuilder password(Consumer<ReactiveOAuth2AuthorizedClientProviderBuilder.PasswordGrantBuilder> builderConsumer) Deprecated.The latest 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- aConsumerofReactiveOAuth2AuthorizedClientProviderBuilder.PasswordGrantBuilderused for further configuration- Returns:
- the
ReactiveOAuth2AuthorizedClientProviderBuilder
-
build
Builds an instance ofDelegatingReactiveOAuth2AuthorizedClientProvidercomposed of one or moreReactiveOAuth2AuthorizedClientProvider(s).- Returns:
- the
DelegatingReactiveOAuth2AuthorizedClientProvider
-