My app has not caught up to the new changes in facebook’s oauth. Before, I was able to request permissions for users then they could access my app. Now, new users are no longer able to grant permissions to my app. They are sent to:
and receive the message “Sorry, something went wrong. We’re working on fixing it as soon as we can.” If, on the other hand, the user had already granted permissions to my app before the oauth, everything was okay.
The php is like this:
$user = $facebook->getUser();
if ($user) {
try {
// If the user has been authenticated then proceed
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
// If the user is authenticated then generate the variable for the logout URL
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
then the user receives the html index page of my app. otherwise, they are supposed to be redirected to the request permissions dialog via the following php at the end of the page:
} else {
$loginUrl = $facebook->getLoginUrl(array('redirect_uri' => $fbconfig['appUrl']));
print "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
}
Like I said, pre-registered users can access the content perfectly, but new members are greeted with the above error rather than the permissions screen.
Can anyone help my fix my permissions problem? Thanks for any advice
The error message you’re getting is
This means you’re trying to redirect the user immediately after login to a page which isn’t part of your app (according to your config)
The most likely cause of this is that the URL Defined in
$fbconfig['appUrl'])doesn’t match what you’ve configured in your app settings in the Site Domain(s) field