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

  • Home
  • SEARCH
  • 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 3486584
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:02:52+00:00 2026-05-18T11:02:52+00:00

Maybe I searched completely in the wrong way, and the facebook documentation pretty much

  • 0

Maybe I searched completely in the wrong way, and the facebook documentation pretty much sucks in my opinion.

I was wondering, I’m connecting to facebook with the settings below and that works (I’m able to retrieve the profile information of the logged in user allows my application to access his profile.) Are there other options I can set, like the callback url and the expiration (which I want to set to never, so I can save the token in my db and re-use it)?

This is the config now:

$facebook = new Facebook(array(
        'appId'  => 'xxxxxxxxxxxx',
        'secret' => 'xxxxxxxxxxxx',
        'cookie' => true
    ));

I’m also connection to twitter and there I’m able to this:

$this->configTwitter = array(
        'callbackUrl' => 'xxxxxxxxxxxx',
        'siteUrl' => 'http://twitter.com/oauth',
        'consumerKey' => 'xxxxxxxxxxxx',
        'consumerSecret' => 'xxxxxxxxxxxx'
    );

Thanks in advance!

Facebook should take a look at Twitter

  • 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-18T11:02:53+00:00Added an answer on May 18, 2026 at 11:02 am

    After trying a few days, spitting the documentation of the Graph OAuth 2.0 (which doesn’t work as good as expected and searching the internet I found a solution which I used to create the following script:

        // Config
        $this->redirectUrl = 'http://www.mywebsite.com/facebook'
        $this->clientId = 'APPLICATION_ID';
        $this->permissions = 'publish_stream,offline_access';
    
        // Check if a sessions is present 
        if(!$_GET['session'])
        {
            // Authorize application
            header('Location: http://www.facebook.com/connect/uiserver.php?app_id='.$this->clientId.'&next='.$this->redirectUrl.'&perms='.$this->permissions.'&return_session=1&session_version=3&fbconnect=0&canvas=1&legacy_return=1&method=permissions.request');
        }
        else
        {
            $token = json_decode($_GET['session']);
                        echo $token->access_token; // This is the access_token you'll need!
    
            // Insert token in the database or whatever you want
        }
    

    This piece of code works great and performs the following actions:

    1. Log in if the user isn’t logged in to facebook
    2. Asks if the user wants to add the application and grants the requested permissions (in my case: publish_stream and offline_access) in one dialog
    3. returns to the page you specified under redirectUrl with an access_token (and because we requested for offline access this one doesn’t expire)

    I then store the token in the database so I won’t have to request it again

    Now you can, if you wish use the facebook code, or you’re own code to get the users data, or other information from facebook (be sure you requested the right permissions)

    Don’t now if this is facebook-valid code, but it works great and I can easily define the ‘config’ like I wanted….

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

Sidebar

Related Questions

I've searched for this, but maybe I'm using the wrong keywords. I have a
What is wrong with the code below? Maybe it would be simpler to just
Maybe this is a dumb question, but is there any way to convert a
I searched the net and books, for an answer but didn't find it. (maybe
I've searched for this everywhere but I can't seem to find a solution; maybe
As subject asks, what is the easiest way to achieve the below input form?
Maybe I just don't know .NET well enough yet, but I have yet to
Maybe the need to do this is a 'design smell' but thinking about another
Maybe I'm just thinking about this too hard, but I'm having a problem figuring
Maybe my understanding of agile development isn't as good as it should be, but

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.