Class: ExternalTokenExchangeAuthorization

Class: ExternalTokenExchangeAuthorization

ExternalTokenExchangeAuthorization

Class used to authorize a mobile user against Oracle Mobile Hub with External Token Authentication security schema. Callers should use MobileBackend's authorization property.
Source:

Extends

Members

isAuthorized :Boolean

Is SDK authorized. Returns true if a user has been authorized, false otherwise. A user can be authorized by calling authenticate() or authenticateAnonymous().
Type:
  • Boolean
Inherited From:
Source:

Methods

authenticate(token) → {Promise.<NetworkResponse>}

Authenticates. Authenticates a user with the given external token. The user remains logged in until logout() is called.
Parameters:
Name Type Description
token String The third party authentication token.
Source:
Returns:
Type
Promise.<NetworkResponse>

authenticateAnonymous() → {Promise.<NetworkResponse>}

Authenticates anonymous. Authenticates an anonymous user against the service. The user remains logged in until logout() is called.
Source:
Returns:
Type
Promise.<NetworkResponse>

getAccessToken() → {String}

Get access token. Returns the current access token from user credentials.
Inherited From:
Source:
Returns:
current access token from user credentials.
Type
String

isTokenValid() → {Boolean}

Is authentication token 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.
Source:
Returns:
Type
Boolean

logout()

Logs out the current user and clears credentials and tokens and cookies.
Source:

onAuthentication(callback)

On authentication event. Subscribe for on authentication event
Parameters:
Name Type Description
callback Authorization~OnAuthenticationCallback The callback that will be called when authentication happen.
Inherited From:
Source:

refreshToken() → {Promise.<String>}

Refreshes the authentication token if it has expired. The authentication scheme should support refresh.
Source:
Returns:
Type
Promise.<String>