You are here

function _fb_settings_parse_signed_request in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 fb_settings.inc \_fb_settings_parse_signed_request()

See https://developers.facebook.com/docs/authentication/signed_request/ for a more reliable version of this function. We skip validation because we do not yet know the app secret.

1 call to _fb_settings_parse_signed_request()
fb_settings_get_facebook_cookie in ./fb_settings.inc
The current format of the cookie is a signed request.

File

./fb_settings.inc, line 74
This file is to be included from your sites/.../settings.php file.

Code

function _fb_settings_parse_signed_request($signed_request) {
  list($encoded_sig, $payload) = explode('.', $signed_request, 2);

  // decode the data
  $sig = _fb_settings_base64_url_decode($encoded_sig);
  $data = json_decode(_fb_settings_base64_url_decode($payload), TRUE);
  return $data;
}