Package com.rabbitmq.client.amqp
Interface OAuth2Settings<T>
- Type Parameters:
T
- the type of object returned by methods, usually the object itself
public interface OAuth2Settings<T>
Configuration to retrieve a token using the OAuth 2 Client Credentials flow.
OAuth 2 requires RabbitMQ 4.1 or more.
- Since:
- 0.4.0
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
TLS settings to request the OAuth 2 token. -
Method Summary
Modifier and TypeMethodDescriptionSet the OAuth 2 client IDclientSecret
(String clientSecret) Set the secret (password) to use to get a token.Connection settings.Set the grant type to use when requesting the token.Set a parameter to pass in the request.shared
(boolean shared) Whether to share the same token between connections.OAuth2Settings.TlsSettings
<? extends T> tls()
TLS configuration for requesting the token.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
. Seetls()
for more information. Applications in production should always use HTTPS to retrieve tokens.- Parameters:
uri
- access URI- Returns:
- OAuth 2 settings
- 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 settings
-
clientSecret
Set the secret (password) to use to get a token.- Parameters:
clientSecret
- client secret- Returns:
- OAuth 2 settings
-
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 settings
-
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 settings
-
tls
OAuth2Settings.TlsSettings<? extends T> tls()TLS configuration for requesting the token.- Returns:
- TLS configuration
-
connection
T connection()Connection settings.- Returns:
- connections settings
-