new SSOAuthorization()
Class used to authorize a mobile user against Oracle Mobile Cloud Service.
Methods
-
authenticate(successCallback, errorCallback)
Authenticates a user with the given credentials using federated single sign-on.
-
Authenticates a user with the given credentials using federated single sign-on. The user remains logged in until logout() is called. You must have SSO enabled for the mobile backend.
Parameters:
Name Type Argument Description successCallback
Authorization~authenticateSuccessCallback <optional>
Optional callback invoked on success (deprecated use promises instead). errorCallback
Authorization~errorCallback <optional>
Optional callback invoked on failure (deprecated use promises instead). Returns:
- Type
- Promise.<(NetworkResponse|NetworkResponse)>
-
authenticateAnonymous(successCallback, errorCallback)
Authenticates an anonymous user against the service.
-
Authenticates an anonymous user against the service. The user remains logged in until logout() is called.
Parameters:
Name Type Argument Description successCallback
Authorization~authenticateSuccessCallback <optional>
Optional callback invoked on success (deprecated use promises instead). errorCallback
Authorization~errorCallback <optional>
Optional callback invoked on failure (deprecated use promises instead). Returns:
- Type
- Promise.<(NetworkResponse|NetworkResponse)>
-
getClientId()
Returns the client ID for the current backend.
-
Returns the client ID for the current backend.
-
getClientSecret()
Returns the client secret for the current backend.
-
Returns the client secret for the current backend.
-
getTenantName()
Returns the tenant name for the current backend.
-
Returns the tenant name for the current backend.
-
isTokenValid()
Checks to see if the OAuth token is null,undefined,NaN,empty string (''),0,false and also checks the timestamp of when the token was first retrieved to see if it was still valid.
-
Checks to see if the OAuth token is null,undefined,NaN,empty string (''),0,false and also checks the timestamp of when the token was first retrieved to see if it was still valid.
Returns:
- Type
- Boolean
-
logout()
Logs out the current user and clears credentials and tokens and cookies.
-
Logs out the current user and clears credentials and tokens and cookies.
-
refreshToken(successCallback, errorCallback)
Refreshes the authentication token if it has expired.
-
Refreshes the authentication token if it has expired. The authentication scheme should support refresh.
Parameters:
Name Type Description successCallback
Authorization~authenticateSuccessCallback Optional callback invoked on success (deprecated use promises instead). errorCallback
Authorization~errorCallback Optional callback invoked on failure (deprecated use promises instead). Returns:
- Type
- Promise.<(NetworkResponse|NetworkResponse)>
-
<inner> clearCookies()
Clears the current session cookies and logs out the user.
-
Clears the current session cookies and logs out the user.
-
<inner> IsInAppBrowserInstalled()
Checks to see if the correct plugin is installed into the application.
-
Checks to see if the correct plugin is installed into the application.
Returns:
- Type
- boolean