PHP Class Gajus\Fuss\AccessToken

Mostrar archivo Open project: gajus/fuss Class Usage Examples

Public Methods

Method Description
__construct ( Gajus\Fuss\App $app, string $access_token, self::TYPE_USER | self::TYPE_APP | self::TYPE_PAGE $type )
extend ( ) : null Extend a short-lived access token for a long-lived access token.
getApp ( ) : Gajus\Fuss\App
getCode ( ) : string Get the code for the long-lived access token.
getExpirationTimestamp ( ) : integer
getInfo ( ) : array Fetch info about the access token from Facebook.
getPlain ( ) : string
getScope ( ) : array
isLong ( ) : boolean The issued_at field is not returned for short-lived access tokens.
makeFromCode ( App $app, string $code, string $redirect_url = '' ) : Gajus\Fuss\AccessToken Exchange code for an access token.

Private Methods

Method Description
debugToken ( ) : null Populate the access token information using data retrieved from Facebook.

Method Details

__construct() public method

public __construct ( Gajus\Fuss\App $app, string $access_token, self::TYPE_USER | self::TYPE_APP | self::TYPE_PAGE $type )
$app Gajus\Fuss\App
$access_token string A string that identifies a user, app, or page and can be used by the app to make graph API calls.
$type self::TYPE_USER | self::TYPE_APP | self::TYPE_PAGE

extend() public method

Upon successfully extending the token, the instance of the object is updated with the long-lived access token.
See also: https://developers.facebook.com/docs/facebook-login/access-tokens#extending
public extend ( ) : null
return null

getApp() public method

public getApp ( ) : Gajus\Fuss\App
return Gajus\Fuss\App $app

getCode() public method

Get the code for the long-lived access token.
See also: https://developers.facebook.com/docs/facebook-login/access-tokens#long-via-code
public getCode ( ) : string
return string

getExpirationTimestamp() public method

public getExpirationTimestamp ( ) : integer
return integer UNIX timestamp in seconds.

getInfo() public method

Fetch info about the access token from Facebook.
public getInfo ( ) : array
return array

getPlain() public method

public getPlain ( ) : string
return string The access token as a string.

getScope() public method

See also: https://developers.facebook.com/docs/facebook-login/permissions/v2.1
public getScope ( ) : array
return array Permissions granted to the access token.

isLong() public method

The issued_at field is not returned for short-lived access tokens.
See also: https://developers.facebook.com/docs/facebook-login/access-tokens#debug
public isLong ( ) : boolean
return boolean

makeFromCode() public static method

Exchange code for an access token.
See also: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.0#exchangecode
public static makeFromCode ( App $app, string $code, string $redirect_url = '' ) : Gajus\Fuss\AccessToken
$app App
$code string The parameter received from the Login Dialog.
$redirect_url string This argument is required and must be the same as the original request_uri that you used when starting the OAuth login process. In case of FB.login, it is empty string.
return Gajus\Fuss\AccessToken