Esempio n. 1
0
 function checkToken()
 {
     // Facebook specific methods...
     $token = $this->getToken();
     // prerequisite
     if ($token && isset($this->client)) {
         // Get the access token metadata from /debug_token
         $tokenMetadata = $this->client->debugToken($token);
         // pickup expiry date
         $expiry = $tokenMetadata->getExpiresAt();
         // FIX: convert to string
         $expiry = $expiry->format($expiry::W3C);
         // Validation (these will throw FacebookSDKException's when they fail)
         //$tokenMetadata->validateAppId( $this->config['appId'] );
         // If you know the user ID this access token belongs to, you can validate it here
         //$tokenMetadata->validateUserId('123');
         //$tokenMetadata->validateExpiration();
         // extend creds
         if (!is_array($_SESSION['oauth'][$this->api])) {
             $_SESSION['oauth'][$this->api] = array();
         }
         array_merge($_SESSION['oauth'][$this->api], array("access_token" => $token, "expiry" => $expiry));
     }
     // continue...
     return parent::checkToken();
 }
Esempio n. 2
0
 public function refreshToken($request = array())
 {
     $request = array("params" => array("grant_type" => "refresh_token"));
     parent::refreshToken($request);
 }