FacebookAuthorization
Class used to authorize a user against Facebook and use the OAuth token from Facebook
to authenticate against Oracle Mobile Hub. 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() → {Promise.<NetworkResponse>}
Authenticates a user against Facebook. The user remains logged in until logout() is called.
In the Facebook Developer console you must define the domain that the application will use.
in the Facebook Developer UI, When you add a platform for the application,
you choose Website and set the site URL to http://localhost/.
- Source:
Returns:
- Type
- Promise.<NetworkResponse>
authenticateAnonymous() → {Promise.<NetworkResponse>}
Authenticate 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
getFacebookAppId() → {String}
Get facebook application id.
Returns the Facebook Application Id token for the current backend.
- Source:
Returns:
- Type
- String
isTokenValid() → {Boolean}
Checks to see if the OAuth token is null, undefined, NaN, AN empty string (''), 0, or false.
It also checks the timestamp
for 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.
- 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.<NetworkResponse>}
Refreshes the authentication token if it has expired from Facebook.
The authentication scheme should support refresh.
- Source:
Returns:
- Type
- Promise.<NetworkResponse>