PHP Class Gajus\Fuss\SignedRequest

Datei anzeigen Open project: gajus/fuss Class Usage Examples

Public Methods

Method 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

Method 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 method

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 method

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

getAppData() public method

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

getPageTab() public method

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

getPayload() public method

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

getUserId() public method

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

isPageTab() public method

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