Class OAuth2ClientCredentialGrantProcessor
-
- All Implemented Interfaces:
public class OAuth2ClientCredentialGrantProcessor extends OAuth2Processor
-
-
Field Summary
Fields Modifier and Type Field Description public final static OAuth2Processor.Companion
Companion
public final static Logger
logger
public final static String
TOKEN_REQUEST_CONTENT_TYPE
public String
responseType
public String
scope
public String
state
public String
secret
public boolean
isRequestReadonlyToken
public boolean
enablePKCE
-
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 OAuth2Token
authenticate()
Starts the OAuth 2.0 authentication process. void
cancelAuthentication()
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.
-
-
-
-