Class: FacebookAuthorization

FacebookAuthorization


new FacebookAuthorization()

Class used to authorize a user against Facebook and use the OAuth token from Facebook to authenicate against Oracle Mobile Cloud Service.

Class used to authorize a user against Facebook and use the OAuth token from Facebook to authenicate against Oracle Mobile Cloud Service. Callers should use MobileBackend's FacebookAuthorization() property. Derives from Authorization.
Source:

Methods


authenticate(successCallback, errorCallback)

Authenticates a user with the given credentials against Facebook.

Authenticates a user with the given credentials 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/.
Parameters:
Name Type Argument Description
successCallback Authorization~authenticateSuccessCallback <optional>
Optional callback invoked on success (deprecated use promises instead).
errorCallback Authorization~authenticateErrorCallback <optional>
Optional callback invoked on failure (deprecated use promises instead).
Source:
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 Description
successCallback Authorization~authenticateSuccessCallback Optional callback invoked on success (deprecated use promises instead).
errorCallback Authorization~authenticateErrorCallback Optional callback invoked on failure (deprecated use promises instead).
Source:
Returns:
Type
Promise.<(NetworkResponse|NetworkResponse)>

getFacebookAppId()

Returns the Facebook Application Id token for the current backend.

Returns the Facebook Application Id token for the current backend.
Source:

isTokenValid()

Checks to see if the OAuth token is null, undefined, NaN, AN empty string (''), 0, or false.

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.

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

refreshToken(successCallback, errorCallback)

Refreshes the authentication token if it has expired from Facebook.

Refreshes the authentication token if it has expired from Facebook. The authentication scheme should support refresh.
Parameters:
Name Type Description
successCallback Authorization~authenticateSuccessCallback Optional callback invoked on success (deprecated use promises instead).
errorCallback Authorization~authenticateErrorCallback Optional callback invoked on failure (deprecated use promises instead).
Source:
Returns:
Type
Promise.<(NetworkResponse|NetworkResponse)>