PHP Class Gajus\Fuss\SignedRequest

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

Méthodes publiques

Méthode Description
__construct ( App $app, string $raw_signed_request )
getAccessToken ( ) : null | Gajus\Fuss\AccessToken Resolve the user access token from the signed request.
getAppData ( ) : mixed The content of the app_data query string parameter which may be passed if the app is being loaded within a Page Tab.
getPageTab ( ) : null | Gajus\Fuss\PageTab Return PageTab when app is loaded in a page tab.
getPayload ( ) : array Return the signed request payload.
getUserId ( ) : null | integer User ID when user access token is in or can be derived from the signed request.
isPageTab ( ) : boolean True if signed request has been acquired through a Page Tab.

Private Methods

Méthode Description
decodeBase64Url ( string $input ) : string The incoming token is encoded using modified base64 encoding for URL, where +/ is replaced with -_ to avoid percent-encoded hexadecimal representation.
parse ( string $raw_signed_request ) : array Parse signed request and validate the signature.

Method Details

__construct() public méthode

public __construct ( App $app, string $raw_signed_request )
$app App
$raw_signed_request string It is base64url encoded and signed with an HMAC version of your App Secret, based on the OAuth 2.0 spec.

getAccessToken() public méthode

The access token is either provided or it can be exchanged for the code.
public getAccessToken ( ) : null | Gajus\Fuss\AccessToken
Résultat null | Gajus\Fuss\AccessToken

getAppData() public méthode

The JSON input is automatically decoded.
See also: https://developers.facebook.com/docs/reference/login/signed-request/
public getAppData ( ) : mixed
Résultat mixed

getPageTab() public méthode

Return PageTab when app is loaded in a page tab.
public getPageTab ( ) : null | Gajus\Fuss\PageTab
Résultat null | Gajus\Fuss\PageTab

getPayload() public méthode

Return the signed request payload.
See also: https://developers.facebook.com/docs/reference/login/signed-request/
public getPayload ( ) : array
Résultat array

getUserId() public méthode

User ID when user access token is in or can be derived from the signed request.
public getUserId ( ) : null | integer
Résultat null | integer

isPageTab() public méthode

True if signed request has been acquired through a Page Tab.
public isPageTab ( ) : boolean
Résultat boolean