Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7646243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:09:27+00:00 2026-05-31T10:09:27+00:00

I was having a problem with continuous redirect for my application that is basically

  • 0

I was having a problem with continuous redirect for my application that is basically requesting basic user info such as name, gender and location.
I went through too much headache until I decided to open up base_facebook.php and trace the flow. I ended up with commenting out the if block that checks whether $sig matches $expected_sig inside the parseSignedRequest function. The application worked fine and displayed the basic information about me. However I wonder if it is safe to do so?!!! and why $expected_sig does not match $sig any help would be appreciated thanks indeed

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

     // decode the data
     $sig = self::base64UrlDecode($encoded_sig);
     $data = json_decode(self::base64UrlDecode($payload), true);

    if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {
      self::errorLog('Unknown algorithm. Expected HMAC-SHA256');
      return null;
    }

    // check sig
    $expected_sig = hash_hmac('sha256', $payload,
                          $this->getAppSecret(), $raw = true);

    var_dump($expected_sig);
    echo '<br/><br/><br/>';
    var_dump($sig);
    // if ($sig !== $expected_sig) {
    //   self::errorLog('Bad Signed JSON signature!');
    //   return null;
    // }

    return $data;
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:09:29+00:00Added an answer on May 31, 2026 at 10:09 am

    This is essential for security reasons. It verifies that the request is coming from facebook because only fb and you know the app secret.

    Realistically the only variables that are going to screw this up is the facebook app secret or some sort of modification to the signed_request. I had this same issue when I was testing because I copied the signed request coming in wrong. Make sure to double check everything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having problem that when i am trying to submit the form by
Having a weird problem with PHPUnit. We're using PHPUnit as part of a continuous
I'm having a problem with a div that fades into the page on slide
I'm having a problem with creating 24/7 video player for my application on WPF
Having problem with the middle Div not expanding to the width http://acs.graphicsmayhem.com/images/middiv.jpg Ok, how
I'm having problem when running my Windows Forms program. In the program, I have
I'm having problem with Rails plugin attachment_fu . On every upload, I get validation
i'm having problem to deal with charset in ruby on rails app, specificially in
I am having problem in getting reference of Ajax control extender using $find() or
I'm having problem selecting an element with an id like this <li =0f:Bactidol_Recorder.mp4>. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.