Package com.rabbitmq.stream
Interface EnvironmentBuilder.OAuth2Configuration
- Enclosing interface:
EnvironmentBuilder
public static interface EnvironmentBuilder.OAuth2Configuration
Configuration to retrieve a token using the OAuth 2 Client Credentials flow.
- Since:
- 1.3.0
-
Method Summary
Modifier and TypeMethodDescriptionSet the OAuth 2 client IDclientSecret
(String clientSecret) Set the secret (password) to use to get a token.Go back to the environment builderSet the grant type to use when requesting the token.Set a parameter to pass in the request.sslContext
(SSLContext sslContext) SSLContext
for HTTPS requests.tokenEndpointUri
(String uri) Set the URI to access to get the token.
-
Method Details
-
tokenEndpointUri
Set the URI to access to get the token.TLS is supported by providing a
HTTPS
URI and setting aSSLContext
. SeeEnvironmentBuilder.tls()
for more information. Applications in production should always use HTTPS to retrieve tokens.- Parameters:
uri
- access URI- Returns:
- OAuth 2 configuration
- See Also:
-
clientId
Set the OAuth 2 client IDThe client ID usually identifies the application that requests a token.
- Parameters:
clientId
- client ID- Returns:
- OAuth 2 configuration
-
clientSecret
Set the secret (password) to use to get a token.- Parameters:
clientSecret
- client secret- Returns:
- OAuth 2 configuration
-
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
- grant type- Returns:
- OAuth 2 configuration
-
parameter
Set a parameter to pass in the request.The OAuth 2 server may require extra parameters to narrow down the identity of the user.
- Parameters:
name
- name of the parametervalue
- value of the parameter- Returns:
- OAuth 2 configuration
-
sslContext
SSLContext
for HTTPS requests.- Parameters:
sslContext
- the SSL context- Returns:
- OAuth 2 configuration
-
environmentBuilder
EnvironmentBuilder environmentBuilder()Go back to the environment builder- Returns:
- the environment builder
-