Class OAuth2ClientCredentialGrantProcessor
-
- All Implemented Interfaces:
public class OAuth2ClientCredentialGrantProcessor extends OAuth2Processor
-
-
Field Summary
Fields Modifier and Type Field Description public final static OAuth2Processor.CompanionCompanionpublic final static Loggerloggerpublic final static StringTOKEN_REQUEST_CONTENT_TYPEpublic StringresponseTypepublic Stringscopepublic Stringstatepublic Stringsecretpublic booleanisRequestReadonlyTokenpublic booleanenablePKCE
-
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. -
Methods inherited from class com.sap.cloud.mobile.foundation.authentication.OAuth2Processor
getEnablePKCE, getResponseType, getScope, getSecret, getState, isAuthenticated, isRequestReadonlyToken, refresh, setEnablePKCE, setRequestReadonlyToken, setResponseType, setScope, setSecret, setState -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
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.- 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.
-
-
-
-