Class OAuth2WebViewProcessor
-
- All Implemented Interfaces:
public final class OAuth2WebViewProcessor extends OAuth2Processor
This class is used by OAuth2Interceptor to authenticate when it detects an OAuth challenge.
-
-
Field Summary
Fields Modifier and Type Field Description private StringresponseTypeprivate Stringscopeprivate Stringstateprivate Stringsecretprivate BooleanisRequestReadonlyTokenprivate BooleanenablePKCE
-
Constructor Summary
Constructors Constructor Description OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration)OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration, OkHttpClient client)OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration, IBackPress iBackPress)OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration, CertificateProvider certificateProvider)OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration, CertificateProvider certificateProvider, IBackPress iBackPress)OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration, CertificateProvider certificateProvider, OkHttpClient client)OAuth2WebViewProcessor(OAuthConfig oAuthConfig, AbstractOAuthClient oAuthClient, OkHttpClient client, CertificateProvider certificateProvider, IBackPress iBackPress)Constructs a new OAuth2WebViewProcessor. OAuth2WebViewProcessor(OAuthConfig oAuthConfig, AbstractOAuthClient oAuthClient, OkHttpClient client, CertificateProvider certificateProvider)Constructs a new OAuth2WebViewProcessor. OAuth2WebViewProcessor(OAuthConfig oAuthConfig, AbstractOAuthClient oAuthClient, OkHttpClient client)Constructs a new OAuth2WebViewProcessor. OAuth2WebViewProcessor(OAuthConfig oAuthConfig, AbstractOAuthClient oAuthClient)Constructs a new OAuth2WebViewProcessor. OAuth2WebViewProcessor(OAuthConfig oAuthConfig)Constructs a new OAuth2WebViewProcessor.
-
Method Summary
Modifier and Type Method Description OAuth2Tokenauthenticate()Starts the OAuth 2.0 authentication process. UnitcancelAuthentication()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
-
OAuth2WebViewProcessor
OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration)
-
OAuth2WebViewProcessor
OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration, OkHttpClient client)
-
OAuth2WebViewProcessor
OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration, IBackPress iBackPress)
-
OAuth2WebViewProcessor
OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration, CertificateProvider certificateProvider)
-
OAuth2WebViewProcessor
OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration, CertificateProvider certificateProvider, IBackPress iBackPress)
-
OAuth2WebViewProcessor
OAuth2WebViewProcessor(OAuth2Configuration oauth2Configuration, CertificateProvider certificateProvider, OkHttpClient client)
-
OAuth2WebViewProcessor
OAuth2WebViewProcessor(OAuthConfig oAuthConfig, AbstractOAuthClient oAuthClient, OkHttpClient client, CertificateProvider certificateProvider, IBackPress iBackPress)
Constructs a new OAuth2WebViewProcessor.- Parameters:
oAuthConfig- the OAuth configurationoAuthClient- the AbstractOAuthClient used as OAuth credentialsclient- the OkHttpClient used to make requestscertificateProvider- used to get a client certificate if the server requestsiBackPress- the callback for WebView device back press
-
OAuth2WebViewProcessor
OAuth2WebViewProcessor(OAuthConfig oAuthConfig, AbstractOAuthClient oAuthClient, OkHttpClient client, CertificateProvider certificateProvider)
Constructs a new OAuth2WebViewProcessor.- Parameters:
oAuthConfig- the OAuth configurationoAuthClient- the AbstractOAuthClient used as OAuth credentialsclient- the OkHttpClient used to make requestscertificateProvider- used to get a client certificate if the server requests
-
OAuth2WebViewProcessor
OAuth2WebViewProcessor(OAuthConfig oAuthConfig, AbstractOAuthClient oAuthClient, OkHttpClient client)
Constructs a new OAuth2WebViewProcessor.- Parameters:
oAuthConfig- the OAuth configurationoAuthClient- the AbstractOAuthClient used as OAuth credentialsclient- the OkHttpClient used to make requests
-
OAuth2WebViewProcessor
OAuth2WebViewProcessor(OAuthConfig oAuthConfig, AbstractOAuthClient oAuthClient)
Constructs a new OAuth2WebViewProcessor.- Parameters:
oAuthConfig- the OAuth configurationoAuthClient- the AbstractOAuthClient used as OAuth credentials
-
OAuth2WebViewProcessor
OAuth2WebViewProcessor(OAuthConfig oAuthConfig)
Constructs a new OAuth2WebViewProcessor.- Parameters:
oAuthConfig- the OAuth configuration
-
-
Method Detail
-
authenticate
@WorkerThread() OAuth2Token authenticate()
Starts the OAuth 2.0 authentication process. When using the Authorization Code Grant type this method will present a web view.
- 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.
-
-
-
-