简体   繁体   English

Facebook应用程序未捕获的OAuthException:

[英]Facebook Application-Uncaught OAuthException:

my aplication is work fine but there is one problem. 我的应用工作正常,但是有一个问题。 when someone try to use my application he/she gets this error. 当有人尝试使用我的应用程序时,他/她会收到此错误。 other problem is after allowing the app it doesnt redirect anywhere, you have to resresf page. 另一个问题是允许应用程序不重定向到任何地方后,您必须重新整理页面。 after allow and refreshing you can use app. 允许和刷新后,您可以使用应用。

my allow code: fb:login-button perms="email,user_birthday,status_update,publish_stream,offline_access"> 我的允许代码:fb:login-button perms =“ email,user_birthday,status_update,publish_stream,offline_access”>

you can check my app page: https://apps.facebook.com/denemeapicik/ 您可以检查我的应用程序页面: https : //apps.facebook.com/denemeapicik/

error: 错误:

Uncaught OAuthException: Error validating access token: User 1000abc has not authorized application 144171878989963. thrown in /home/xyzz/facebook.php on line 560 未捕获的OAuthException:验证访问令牌时出错:用户1000abc未授权应用程序144171878989963。在第560行的/home/xyzz/facebook.php中抛出

ı try this but it doesnt work: 我尝试一下,但是不起作用:

$params = array(
'scope' => 'read_stream, friends_likes',
'redirect_uri' => 'https://www.myapp.com/post_login_page'
);

$loginUrl = $facebook->getLoginUrl($params);
require_once("facebook.php");
$facebook = new Facebook(array(
    'appId'  => '***',
    'secret' => '***',
  'scope'  => 'manage_pages,offline_access,publish_stream,user_photos'
));

$user = $facebook->getUser();

if ($user) {
  try {
    // Proceed knowing you have a logged in user who's authenticated.
    $user_profile = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    $user = null;
  }
}

if ($user) {
  $logoutUrl = $facebook->getLogoutUrl();
} else {
  $loginUrl = $facebook->getLoginUrl();
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM