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 6603723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:03:12+00:00 2026-05-25T19:03:12+00:00

I am attempting a test app to learn on facebook. I am using this

  • 0

I am attempting a test app to learn on facebook. I am using this code from the facebook developer page:

 <?php 

     $app_id = "YOUR_APP_ID";

     $canvas_page = "YOUR_CANVAS_PAGE_URL";

     $auth_url = "http://www.facebook.com/dialog/oauth?client_id=" 
            . $app_id . "&redirect_uri=" . urlencode($canvas_page);

     $signed_request = $_REQUEST["signed_request"];

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

     $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);

     if (empty($data["user_id"])) {
            echo("<script> top.location.href='" . $auth_url . "'</script>");
     } else {
            echo ("Welcome User: " . $data["user_id"]);
     } 
 ?>

When I run this I get:

Message: Undefined index: signed_request

I am using this in Codeigniter. I have no idea if that matters.. When I run this it uses the $auth_url and return:

http://mydomain.com/responsepage?code=biglongstring

so I know I am getting to facebook and getting something…

In that string url returned is a variable named “code.” I tried to change the $_REQUEST object to look for “code” but it gives the same error.

It does redirect me back to my response page after it briefly displays the error because the “user_id” element is empty. It is empty because signed_request is not present in the url sent back.

What am I doing wrong? It should go to facebook, ask for me to allow the app, display the user_id. For some reason the signed_request just isn’t there.

Thank you.

EDIT: I’m looking at this again. Where does it ever actually go out and use that URL?

EDIT: If I use the $auth_url manually, pasting it in the address of the browser it redirects back to my response page with no problem. Of course, I did not see a variable named signed_request, just “code” so I don’t know what’s going on.

  • 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-25T19:03:13+00:00Added an answer on May 25, 2026 at 7:03 pm

    Okay it seems that you are using your Canvas URL in the $canvas_page variable which is wrong. You need to use the Canvas Page which is something like: http://apps.facebook.com/appnamespace

    This way, your app will open inside the iframe and Facebook will be able to send you the signed_request

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

Sidebar

Related Questions

Attempting to use the data series from this example no longer passes the JSONLint
I am attempting to write some tests using webtest to test out my python
I'm trying to develop a Facebook app on Heroku with PHP. I set up
I have a Django app we're attempting to deploy to a Tomcat server, using
I am attempting to launch a simple test app on the Android emulator (developing
I'm attempting to learn some Python and Tkinter. The sample code below is intended
I am attempting to run some unit tests on my spring web app using
Background I'm attempting to test my models. app/models/user.rb class User < ActiveRecord::Base has_many :payor_transactions,
I'm attempting to launch a GeoDjango app. I've installed Postgres & PostGIS using brew
I'm attempting to connect to an existing Comet-style long-poll service using an AIR app.

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.