English 中文(简体)
面对面会议
原标题:facebook getting session_key for offline_access in canvas application

Hey everyone, I am trying to get the session_key and secret for a facebook session (offline_access) in canvas application.

However, I am unable to get these two particular variables. When, I am testing the same code locally, I can get the variables above (but this can be because the local app is not a canvas application)

• 采用以下代码进行转导:

$facebook->getLoginUrl(array(
    canvas  => 1,
    fbconnect  => 0,
    req_perms  =>  user_status,publish_stream,offline_access 
));

难道有人会告诉我,当用户授权申请时,我怎么能够 gr上<条码>、_key和secret<>/code>? (永久上网)

这方面的一个例子是<条码>。 倾销通过Face:

Array (
   [uid] => 100000926583671
   [session_key] => 
   [expires] => 0 
   [secret] => 
   [base_domain] => 
   [access_token] => 183043495039366|3ab6ac2asdkhj1bcfdec13d7-100000926583671|jJQaIT-n80YxioAasdwN0cm99U 
   [sig] => 2f64sadasc1da31c12927a052752776
)

错误是:

Array (
   [error] => Array (
          [type] => OAuthException 
          [message] => An active access token must be used to query information about the current user. 
          )
   )
最佳回答

<session_key and secret are now deprecated,Facebook希望你使用Oauth accreditationschema。 然后,您必须使用。 (你正确地拿到一笔钱)来打你。

Try:

$session = $facebook->getSession();
$me = $facebook->api( /100000926583671 , 
                     array( access_token  => $session[ access_token ])
      );
var_dump($me);

Ref: http://developers.facebook.com/docs/authentication/

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...