PHP Class Gajus\Fuss\AccessToken

Afficher le fichier Open project: gajus/fuss Class Usage Examples

Méthodes publiques

Méthode 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

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

Method Details

__construct() public méthode

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 méthode

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
Résultat null

getApp() public méthode

public getApp ( ) : Gajus\Fuss\App
Résultat Gajus\Fuss\App $app

getCode() public méthode

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
Résultat string

getExpirationTimestamp() public méthode

public getExpirationTimestamp ( ) : integer
Résultat integer UNIX timestamp in seconds.

getInfo() public méthode

Fetch info about the access token from Facebook.
public getInfo ( ) : array
Résultat array

getPlain() public méthode

public getPlain ( ) : string
Résultat string The access token as a string.

getScope() public méthode

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

isLong() public méthode

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
Résultat boolean

makeFromCode() public static méthode

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.
Résultat Gajus\Fuss\AccessToken