Class OAuth2ClientCredentialGrantProcessor
-
- All Implemented Interfaces:
public class OAuth2ClientCredentialGrantProcessor extends OAuth2Processor
-
-
Constructor Summary
Constructors Constructor Description OAuth2ClientCredentialGrantProcessor(OAuth2Configuration oauth2Configuration)OAuth2ClientCredentialGrantProcessor(OAuth2Configuration oauth2Configuration, OkHttpClient client)OAuth2ClientCredentialGrantProcessor(OAuthConfig oAuthConfig)Constructs a new OAuth2ClientCredentialGrantProcessor. OAuth2ClientCredentialGrantProcessor(OAuthConfig oAuthConfig, AbstractOAuthClient oAuthClient, OkHttpClient client)Constructs a new OAuth2ClientCredentialGrantProcessor.
-
Method Summary
Modifier and Type Method Description OAuth2Tokenauthenticate()Starts the OAuth 2.0 authentication process. voidcancelAuthentication()Cancels the ongoing authentication process. -
-
Constructor Detail
-
OAuth2ClientCredentialGrantProcessor
OAuth2ClientCredentialGrantProcessor(OAuth2Configuration oauth2Configuration)
- Parameters:
oauth2Configuration- Contains the configuration information.
-
OAuth2ClientCredentialGrantProcessor
OAuth2ClientCredentialGrantProcessor(OAuth2Configuration oauth2Configuration, OkHttpClient client)
- Parameters:
oauth2Configuration- Contains the configuration information.client- The OkHttpClient that will be used to make requests.
-
OAuth2ClientCredentialGrantProcessor
OAuth2ClientCredentialGrantProcessor(OAuthConfig oAuthConfig)
Constructs a new OAuth2ClientCredentialGrantProcessor. When needed, the OkHttpClient will be retrieved from com.sap.cloud.mobile.foundation.common.ClientProvider, so make sure it has a client set.
- Parameters:
oAuthConfig- the OAuth configuration
-
OAuth2ClientCredentialGrantProcessor
OAuth2ClientCredentialGrantProcessor(OAuthConfig oAuthConfig, AbstractOAuthClient oAuthClient, OkHttpClient client)
Constructs a new OAuth2ClientCredentialGrantProcessor.
- Parameters:
oAuthConfig- the OAuth configurationoAuthClient- the AbstractOAuthClient used as OAuth credentialsclient- the OkHttpClient used to make requests
-
-
Method Detail
-
authenticate
@WorkerThread()@Nullable() OAuth2Token authenticate()
Starts the OAuth 2.0 authentication process.
- Returns:
The obtained OAuth2Token if the process was successful, otherwise null.
-
cancelAuthentication
void cancelAuthentication()
Cancels the ongoing authentication process. Does nothing if there was no ongoing authentication.
-
-
-
-