public class ClientCredentialsAuthManager extends io.apimatic.core.authentication.HeaderAuth implements ClientCredentialsAuth
| Constructor and Description |
|---|
ClientCredentialsAuthManager(ClientCredentialsAuthModel authModel)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
io.apimatic.coreinterfaces.http.request.Request |
apply(io.apimatic.coreinterfaces.http.request.Request httpRequest)
Apply the Header authentication.
|
void |
applyGlobalConfiguration(io.apimatic.core.GlobalConfiguration config)
Apply GlobalConfiguration for token management.
|
boolean |
equals(String oAuthClientId,
String oAuthClientSecret,
OAuthToken oAuthToken)
Checks if provided credentials matched with existing ones.
|
OAuthToken |
fetchToken()
Fetch the OAuth token.
|
OAuthToken |
fetchToken(Map<String,Object> additionalParameters)
Fetch the OAuth token.
|
CompletableFuture<OAuthToken> |
fetchTokenAsync()
Fetch the OAuth token asynchronously.
|
CompletableFuture<OAuthToken> |
fetchTokenAsync(Map<String,Object> additionalParameters)
Fetch the OAuth token asynchronously.
|
String |
getErrorMessage()
Returns the error message if the auth credentials are not valid.
|
String |
getOAuthClientId()
String value for oAuthClientId.
|
String |
getOAuthClientSecret()
String value for oAuthClientSecret.
|
OAuthToken |
getOAuthToken()
OAuthToken value for oAuthToken.
|
boolean |
isTokenExpired()
Has the OAuth token expired?.
|
boolean |
isTokenExpired(OAuthToken oAuthToken)
A utility to check the expiry of the OAuth Token.
|
String |
toString()
Converts this ClientCredentialsAuthManager into string format.
|
void |
validate()
Validate the authentication on the httpRequest
|
public ClientCredentialsAuthManager(ClientCredentialsAuthModel authModel)
public void applyGlobalConfiguration(io.apimatic.core.GlobalConfiguration config)
config - GlobalConfiguration instancepublic String getOAuthClientId()
getOAuthClientId in interface ClientCredentialsAuthpublic String getOAuthClientSecret()
getOAuthClientSecret in interface ClientCredentialsAuthpublic OAuthToken getOAuthToken()
getOAuthToken in interface ClientCredentialsAuthpublic boolean equals(String oAuthClientId, String oAuthClientSecret, OAuthToken oAuthToken)
equals in interface ClientCredentialsAuthoAuthClientId - String value for credentials.oAuthClientSecret - String value for credentials.oAuthToken - OAuthToken value for credentials.public String toString()
public CompletableFuture<OAuthToken> fetchTokenAsync(Map<String,Object> additionalParameters)
fetchTokenAsync in interface ClientCredentialsAuthadditionalParameters - Additional parameters to send during authorization.public CompletableFuture<OAuthToken> fetchTokenAsync()
fetchTokenAsync in interface ClientCredentialsAuthpublic OAuthToken fetchToken(Map<String,Object> additionalParameters) throws ApiException, IOException
fetchToken in interface ClientCredentialsAuthadditionalParameters - Additional parameters to send during authorization.ApiExceptionIOExceptionpublic OAuthToken fetchToken() throws ApiException, IOException
fetchToken in interface ClientCredentialsAuthApiExceptionIOExceptionpublic boolean isTokenExpired()
isTokenExpired in interface ClientCredentialsAuthpublic boolean isTokenExpired(OAuthToken oAuthToken)
isTokenExpired in interface ClientCredentialsAuthoAuthToken - The OAuth token for whose expiry is to check.public void validate()
validate in class io.apimatic.core.authentication.AuthCredentialpublic io.apimatic.coreinterfaces.http.request.Request apply(io.apimatic.coreinterfaces.http.request.Request httpRequest)
apply in class io.apimatic.core.authentication.HeaderAuthhttpRequest - The HTTP request on which the auth is to be applied.Request The HTTP request after applying auth.public String getErrorMessage()
getErrorMessage in class io.apimatic.coreinterfaces.authentication.AuthenticationCopyright © 2025. All rights reserved.