public final class MfaRegistrationContext
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createTenantIdentifier(android.content.Context context)
Creates a new unique identifier for the tenant.
|
void |
discover(java.lang.String endpointUrl,
IMfaRegistrationResultCallback callback)
Acquires the OAuth client identifier and endpoint for converting an authorization code into
an access token.
|
java.lang.String |
getDeviceToken(android.content.Context context)
Returns the unique token to identify the device fo push notifications.
|
javax.net.ssl.SSLContext |
getSslContext()
Returns the
SSLContext object. |
void |
setConnectionTimeOut(int connectionTimeOut)
Sets the connection timeout to a specified timeout, in milliseconds.
|
void |
setDeviceToken(android.content.Context context,
java.lang.String deviceToken)
Stores the device token for push notification into SharedPreferences.
|
void |
setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
Sets the
HostnameVerifier to use self-signed or unknown certificates for HttpsURLConnection ,
hat the host name is an acceptable match with the server's authentication scheme. |
void |
setReadTimeOut(int readTimeOut)
Sets the read timeout to a specified timeout, in milliseconds.
|
void |
setSslContext(javax.net.ssl.SSLContext sslContext)
Sets the
SSLContext to use self-signed or unknown certificates for HttpsURLConnection . |
static MfaRegistrationContext |
sharedInstance()
Returns an instance of a new
MfaRegistrationContext object. |
void |
unregisterDevice(java.lang.String endpointUrl,
OAuthToken token,
java.lang.String authenticator_id,
IUnregisterResultCallback callback)
Unregister the device.
|
public static MfaRegistrationContext sharedInstance()
MfaRegistrationContext
object.MfaRegistrationContext
object.public java.lang.String createTenantIdentifier(android.content.Context context)
context
- The context of the application.RegistrationAttributes.TENANT_IDENTIFIER
key.public java.lang.String getDeviceToken(android.content.Context context)
context
- the context of the applicationpublic void setDeviceToken(android.content.Context context, java.lang.String deviceToken)
context
- the context of the applicationdeviceToken
- the unique token to identify the devicepublic void discover(java.lang.String endpointUrl, IMfaRegistrationResultCallback callback) throws java.lang.IllegalArgumentException
endpointUrl
- the endpoint that gets the additional information for obtaining an access tokencallback
- the function delegate that is invoked with a MfaRegistrationResult
java.lang.IllegalArgumentException
- if callback is nullpublic void unregisterDevice(java.lang.String endpointUrl, OAuthToken token, java.lang.String authenticator_id, IUnregisterResultCallback callback) throws java.lang.IllegalArgumentException
endpointUrl
- the endpoint to unregister the devicetoken
- the OAuthToken
to consume with the requestauthenticator_id
- the identifier of the devicecallback
- the function delegate that is invoked with a MfaUnregisterDeviceResult
java.lang.IllegalArgumentException
- if callback is nullpublic void setReadTimeOut(int readTimeOut) throws java.lang.IllegalArgumentException
30000
.readTimeOut
- time out in millisecondsjava.lang.IllegalArgumentException
- if parameter is <= 0public void setConnectionTimeOut(int connectionTimeOut) throws java.lang.IllegalArgumentException
30000
.connectionTimeOut
- time out in millisecondsjava.lang.IllegalArgumentException
- if parameter is <= 0public javax.net.ssl.SSLContext getSslContext()
SSLContext
object.SSLContext
public void setSslContext(javax.net.ssl.SSLContext sslContext)
SSLContext
to use self-signed or unknown certificates for HttpsURLConnection
.
If sslContext is not null, it will be used to validate the HttpsURLConnection
,
otherwise it won't be set.
One way to provide a sslContext is described here
sslContext
- A SSLContext instance that contains the list of certificates.public void setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
HostnameVerifier
to use self-signed or unknown certificates for HttpsURLConnection
,
hat the host name is an acceptable match with the server's authentication scheme.
hostnameVerifier
will only be set if BaseNetworkContext.sslContext
is set as well (not null).
If hostnameVerifier is not null, the overwritten HostnameVerifier.verify(String, SSLSession)
method will be invoked to verify the host name. Otherwise the inherited HostnameVerifier
instance is used.
hostnameVerifier
- A HostnameVerifier
instance that contains an overwritten
HostnameVerifier.verify(String, SSLSession)
method