Class OAuth2PasswordProcessor
-
- All Implemented Interfaces:
public final class OAuth2PasswordProcessor extends OAuth2Processor
Handles authentication with OAuth2 One-time Passcode. In the type of OAuthClientPassword as designated OAuth2 client, it can authenticate with server programmatically without launching webview or browser.
-
-
Field Summary
Fields Modifier and Type Field Description private String
responseType
private String
scope
private String
state
private String
secret
private Boolean
isRequestReadonlyToken
private Boolean
enablePKCE
-
Constructor Summary
Constructors Constructor Description OAuth2PasswordProcessor(OAuthConfig oAuthConfig)
OAuth2PasswordProcessor(OAuthConfig oAuthConfig, OAuthClientPassword oAuthClient, OkHttpClient okHttpClient)
-
Method Summary
Modifier and Type Method Description OAuth2Token
authenticate()
Starts the OAuth 2.0 authentication process. Unit
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
-
OAuth2PasswordProcessor
OAuth2PasswordProcessor(OAuthConfig oAuthConfig)
-
OAuth2PasswordProcessor
OAuth2PasswordProcessor(OAuthConfig oAuthConfig, OAuthClientPassword oAuthClient, OkHttpClient okHttpClient)
-
-
Method Detail
-
authenticate
@WorkerThread() OAuth2Token authenticate()
Starts the OAuth 2.0 authentication process.
- Returns:
The obtained OAuth2Token if the process was successful, otherwise null.
-
cancelAuthentication
Unit cancelAuthentication()
Cancels the ongoing authentication process. Does nothing if there was no ongoing authentication.
-
-
-
-