1

-----------------------------here received 32 length key auth_token Error during REST auth.getSession call: params = api_key:--- ----------- auth_token:-------------------------------------------- call_id:---- -----.-----[像十进制值格式:JSON 方法:facebook.auth.getSession v:1.0 response = {"error_code":100,"error_msg":"Invalid parameter", “请求参数”:[

   {"key":"api_key","value":"---------------"},
   {"key":"auth_token","value":"----------------------"},
   {"key":"call_id","value":"-------------------"},
   {"key":"format","value":"JSON"},
   {"key":"method","value":"facebook.auth.getSession"},
   {"key":"v","value":"1.0"},
   {"key":"sig","value":"f253b75e337776756a1fba88f085c269"}]}
    WWW::Facebook::API=HASH(0xa203ce8)

我需要转换收到的 auth_token 怎么做?我如何验证是否收到了正确的密钥。

  #!/usr/bin/perl -w

 use strict;
 use warnings;
 use CGI;
 use WWW::Facebook::API;
 use WWW::Facebook::API::Auth;

 use HTTP::Request;
 use LWP;

 my $TMP    = $ENV{HOME}.'/tmp';

 my $facebook_api      = '--------';
 my $facebook_secret   = '-------';
 my $facebook_clientid = '--------';

 my $gmail_user        = '-------';
 my $gmail_password    = '--------';

 my $client = WWW::Facebook::API->new(

 desktop         => 1,
 api_version     => '1.0',
 api_key         => $facebook_api,
 secret          => $facebook_secret,
 throw_errors    => 1,     
 );

 $client->app_id($facebook_clientid);

 local $SIG{INT} = sub {
 print "Logging out of Facebookn";
 my $r = $client->auth->logout;
 exit(1);
  };

 my $token = $client->auth->create_token;
 print "$token \n";

 $client->auth->get_session($token);
 print "$client \n";
4

1 回答 1

0

WWW:Facebook:Api 已弃用(最新版本 - 2010 年 3 月 12 日)。API似乎坏了。您应该改用 Facebook::Graph。

于 2013-11-06T16:07:35.407 回答