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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T13:10:14+00:00 2026-06-18T13:10:14+00:00

Documentation says: redirect_uri – (optional) The URL to redirect the user to once the

  • 0

Documentation says:
“redirect_uri – (optional) The URL to redirect the user to once the login/authorization process is complete. The user will be redirected to the URL on both login success and failure, so you must check the error parameters in the URL as described in the authentication documentation. If this property is not specified, the user will be redirected to the current URL (i.e. the URL of the page where this method was called, typically the current URL in the user’s browser).”
So there is a method to catch if user refused autnentication/permissions, but link to corresponding documentation doesnt exist anymore (https://developers.facebook.com/docs/authentication/).

For the simplicity, redirect_uri is same address as a starting php file, and the php code is as simple as:

require 'facebook.php';
$facebook = new Facebook(array(
  'appId'  => 'X',
  'secret' => 'Y',
));
$user = $facebook->getUser();
if ($user) {
  try {
    $user_profile = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    error_log($e);
    $user = null;
  }
}
if (!$user) {
  $params = array(
    'scope' => 'read_stream, friends_likes',
    'redirect_uri' => 'http://myapp.com/app'
  );
  $loginUrl = $facebook->getLoginUrl($params);
}

Anybody knows how to catch that information?

  • 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-06-18T13:10:15+00:00Added an answer on June 18, 2026 at 1:10 pm

    You can do following to check the permissions:

    $permissions = $facebook->api("/me/permissions");
    if( array_key_exists('publish_stream', $permissions['data'][0]) ) {
        // Permission is granted!
        // Do the related task
        $post_id = $facebook->api('/me/feed', 'post', array('message'=>'Hello World!'));
    } else {
        // We don't have the permission
        // Alert the user or ask for the permission!
        header( "Location: " . $facebook->getLoginUrl(array("scope" => "publish_stream")) );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The documentation says that the error() signal will be emitted if the child process
Documentation says org.springframework.web.filter.OncePerRequestFilter guarantees to be just executed once per request . Under what
communicate 's documentation says: Interact with process: Send data to stdin. Read data from
The documentation says If you use the following values, then you will get this
shelve documentation says: The choice of which database package will be used (such as
The documentation says otherwise (The body delegate is invoked once for each value in
Documentation says: The Grails team discourages the embedding of core application logic inside controllers,
Documentation says Dictionary keys order is unspecified. I guess it means the first added
Java documentation says that a ServerSocket , x , that is listening on, say,
The documentation says that execute() must be called from a UI thread. But, since

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.