class JFacebookOAuth extends JOAuth2Client

Joomla Platform class for generating Facebook API access token.

Methods

__construct( Registry $options = null, JHttp $client = null, JInput $input = null)

Constructor.

string
authenticate()

Get the access token or redict to the authentication URL.

boolean
isAuthenticated()

Verify if the client has been authenticated

JHttpResponse
createUrl()

Create the URL for authentication.

string
query( string $url, mixed $data = null, array $headers = array(), string $method = 'get', int $timeout = null)

Send a signed Oauth request.

mixed
getOption( string $key)

Get an option from the JOAuth2Client instance.

setOption( string $key, mixed $value)

Set an option for the JOAuth2Client instance.

array
getToken()

Get the access token from the JOAuth2Client instance.

setToken( array $value)

Set an option for the JOAuth2Client instance.

array
refreshToken( string $token = null)

Refresh the access token instance.

JFacebookOauth
setScope( string $scope)

Method used to set permissions.

string
getScope()

Method to get the current scope

Details

__construct( Registry $options = null, JHttp $client = null, JInput $input = null)

Constructor.

Parameters

Registry $options JOAuth2Client options object
JHttp $client The HTTP client object.
JInput $input The input object

string authenticate()

Get the access token or redict to the authentication URL.

Return Value

string The access token

Exceptions

RuntimeException

boolean isAuthenticated()

Verify if the client has been authenticated

Return Value

boolean Is authenticated

JHttpResponse createUrl()

Create the URL for authentication.

Return Value

JHttpResponse The HTTP response

Exceptions

InvalidArgumentException

string query( string $url, mixed $data = null, array $headers = array(), string $method = 'get', int $timeout = null)

Send a signed Oauth request.

Parameters

string $url The URL for the request.
mixed $data The data to include in the request
array $headers The headers to send with the request
string $method The method with which to send the request
int $timeout The timeout for the request

Return Value

string The URL.

Exceptions

InvalidArgumentException
RuntimeException

mixed getOption( string $key)

Get an option from the JOAuth2Client instance.

Parameters

string $key The name of the option to get

Return Value

mixed The option value

JOAuth2Client setOption( string $key, mixed $value)

Set an option for the JOAuth2Client instance.

Parameters

string $key The name of the option to set
mixed $value The option value to set

Return Value

JOAuth2Client This object for method chaining

array getToken()

Get the access token from the JOAuth2Client instance.

Return Value

array The access token

JOAuth2Client setToken( array $value)

Set an option for the JOAuth2Client instance.

Parameters

array $value The access token

Return Value

JOAuth2Client This object for method chaining

array refreshToken( string $token = null)

Refresh the access token instance.

Parameters

string $token The refresh token

Return Value

array The new access token

Exceptions

Exception
RuntimeException

JFacebookOauth setScope( string $scope)

Method used to set permissions.

Parameters

string $scope Comma separated list of permissions.

Return Value

JFacebookOauth This object for method chaining

string getScope()

Method to get the current scope

Return Value

string Comma separated list of permissions.