Package com.rabbitmq.client.impl
Class OAuth2ClientCredentialsGrantCredentialsProvider.OAuth2ClientCredentialsGrantCredentialsProviderBuilder
java.lang.Object
com.rabbitmq.client.impl.OAuth2ClientCredentialsGrantCredentialsProvider.OAuth2ClientCredentialsGrantCredentialsProviderBuilder
- Enclosing class:
OAuth2ClientCredentialsGrantCredentialsProvider
public static class OAuth2ClientCredentialsGrantCredentialsProvider.OAuth2ClientCredentialsGrantCredentialsProviderBuilder
extends Object
Helper to create
OAuth2ClientCredentialsGrantCredentialsProvider
instances.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create theOAuth2ClientCredentialsGrantCredentialsProvider
instance.Set the OAuth 2 client IDclientSecret
(String clientSecret) Set the secret (password) to use to get a token.connectionConfigurator
(Consumer<HttpURLConnection> connectionConfigurator) A hook to configure theHttpURLConnection
before the request is sent.Set the grant type to use when requesting the token.Extra parameters to pass in the request.tls()
Get access to the TLS configuration to get the token on HTTPS.tokenEndpointUri
(String tokenEndpointUri) Set the URI to request to get the token.
-
Constructor Details
-
OAuth2ClientCredentialsGrantCredentialsProviderBuilder
public OAuth2ClientCredentialsGrantCredentialsProviderBuilder()
-
-
Method Details
-
tokenEndpointUri
public OAuth2ClientCredentialsGrantCredentialsProvider.OAuth2ClientCredentialsGrantCredentialsProviderBuilder tokenEndpointUri(String tokenEndpointUri) Set the URI to request to get the token.- Parameters:
tokenEndpointUri
-- Returns:
- this builder instance
-
clientId
public OAuth2ClientCredentialsGrantCredentialsProvider.OAuth2ClientCredentialsGrantCredentialsProviderBuilder clientId(String clientId) Set the OAuth 2 client IDThe client ID usually identifies the application that requests a token.
- Parameters:
clientId
-- Returns:
- this builder instance
-
clientSecret
public OAuth2ClientCredentialsGrantCredentialsProvider.OAuth2ClientCredentialsGrantCredentialsProviderBuilder clientSecret(String clientSecret) Set the secret (password) to use to get a token.- Parameters:
clientSecret
-- Returns:
- this builder instance
-
grantType
public OAuth2ClientCredentialsGrantCredentialsProvider.OAuth2ClientCredentialsGrantCredentialsProviderBuilder grantType(String grantType) Set the grant type to use when requesting the token.The default is
client_credentials
, but some OAuth 2 servers can use non-standard grant types to request tokens with extra-information.- Parameters:
grantType
-- Returns:
- this builder instance
-
parameter
public OAuth2ClientCredentialsGrantCredentialsProvider.OAuth2ClientCredentialsGrantCredentialsProviderBuilder parameter(String name, String value) Extra parameters to pass in the request.These parameters can be used by the OAuth 2 server to narrow down the identify of the user.
- Parameters:
name
-value
-- Returns:
- this builder instance
-
connectionConfigurator
public OAuth2ClientCredentialsGrantCredentialsProvider.OAuth2ClientCredentialsGrantCredentialsProviderBuilder connectionConfigurator(Consumer<HttpURLConnection> connectionConfigurator) A hook to configure theHttpURLConnection
before the request is sent.Can be used to configuration settings like timeouts.
- Parameters:
connectionConfigurator
-- Returns:
- this builder instance
-
tls
Get access to the TLS configuration to get the token on HTTPS.It is recommended that applications in production use HTTPS and configure it properly to perform token retrieval. Not doing so could result in sensitive data transiting in clear on the network.
You can "exit" the TLS configuration and come back to the builder by calling
OAuth2ClientCredentialsGrantCredentialsProvider.TlsConfiguration.builder()
.- Returns:
- the TLS configuration for this builder.
- See Also:
-
build
Create theOAuth2ClientCredentialsGrantCredentialsProvider
instance.- Returns:
-