public function testSessionInfo()
 {
     $params = array('input_token' => FacebookTestHelper::$testSession->getToken());
     $response = (new FacebookRequest(new FacebookSession(FacebookTestHelper::getAppToken()), 'GET', '/debug_token', $params))->execute()->getGraphObject(GraphSessionInfo::className());
     $this->assertTrue($response instanceof GraphSessionInfo);
     $this->assertNotNull($response->getAppId());
     $this->assertTrue($response->isValid());
 }
 /**
  * Get more info about an access token.
  *
  * @param string|null $appId
  * @param string|null $appSecret
  *
  * @return GraphSessionInfo
  */
 public function getInfo($appId = null, $appSecret = null)
 {
     $params = array('input_token' => $this->accessToken);
     $request = new FacebookRequest(FacebookSession::newAppSession($appId, $appSecret), 'GET', '/debug_token', $params);
     $response = $request->execute()->getGraphObject(GraphSessionInfo::className());
     // Update the data on this token
     if ($response->getExpiresAt()) {
         $this->expiresAt = $response->getExpiresAt();
     }
     return $response;
 }
Exemplo n.º 3
0
 /**
  * getSessionInfo - Makes a request to /debug_token with the appropriate
  *   arguments to get debug information about the sessions token.
  *
  * @param string|null $appId
  * @param string|null $appSecret
  *
  * @return GraphSessionInfo
  */
 public function getSessionInfo($appId = null, $appSecret = null)
 {
     return (new FacebookRequest(static::newAppSession($appId, $appSecret), 'GET', '/debug_token', array('input_token' => $this->getToken())))->execute()->getGraphObject(GraphSessionInfo::className());
 }