Class TokenClient
java.lang.Object
org.apache.pulsar.client.impl.auth.oauth2.protocol.TokenClient
- All Implemented Interfaces:
AutoCloseable,ClientCredentialsExchanger
A client for an OAuth 2.0 token endpoint.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Performs a token exchange using client credentials.
-
Field Details
-
DEFAULT_CONNECT_TIMEOUT_IN_SECONDS
protected static final int DEFAULT_CONNECT_TIMEOUT_IN_SECONDS- See Also:
-
DEFAULT_READ_TIMEOUT_IN_SECONDS
protected static final int DEFAULT_READ_TIMEOUT_IN_SECONDS- See Also:
-
-
Constructor Details
-
TokenClient
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
exchangeClientCredentials
public TokenResult exchangeClientCredentials(ClientCredentialsExchangeRequest req) throws TokenExchangeException, IOException Performs a token exchange using client credentials.- Specified by:
exchangeClientCredentialsin interfaceClientCredentialsExchanger- Parameters:
req- the client credentials request details.- Returns:
- a token result
- Throws:
TokenExchangeExceptionIOException- if a general IO error occurred.
-