Exemple #1
0
 public function testNonTossedSignedtoken() {
   $facebook = new FBPublic(array(
     'appId'  => self::APP_ID,
     'secret' => self::SECRET
   ));
   $payload = $facebook->publicParseSignedRequest(
     self::$kNonTosedSignedRequest);
   $this->assertNotNull($payload, 'Expected token to parse');
   $this->assertNull($facebook->getSignedRequest());
   $_REQUEST['signed_request'] = self::$kNonTosedSignedRequest;
   $this->assertEquals($facebook->getSignedRequest(),
     array('algorithm' => 'HMAC-SHA256'));
 }
Exemple #2
0
 public function testNonTossedSignedtoken()
 {
     $facebook = new FBPublic(array('appId' => self::APP_ID, 'secret' => self::SECRET));
     $payload = $facebook->publicParseSignedRequest(self::kNonTosedSignedRequest());
     $this->assertNotNull($payload, 'Expected token to parse');
     $this->assertNull($facebook->getSignedRequest());
     $_REQUEST['signed_request'] = self::kNonTosedSignedRequest();
     $sr = $facebook->getSignedRequest();
     $this->assertTrue(isset($sr['algorithm']));
 }
Exemple #3
0
 public function testNonTossedSignedtoken()
 {
     $facebook = new FBPublic(array('appId' => self::APP_ID, 'secret' => self::SECRET));
     $payload = $facebook->publicParseSignedRequest(self::$NON_TOSSED_SIGNED_REQUEST);
     $this->assertNotNull($payload, 'Expected token to parse');
     $session = $facebook->publicCreateSessionFromSignedRequest($payload);
     $this->assertNull($session);
     $this->assertNull($facebook->getSignedRequest());
     $_REQUEST['signed_request'] = self::$NON_TOSSED_SIGNED_REQUEST;
     $this->assertEquals($facebook->getSignedRequest(), array('algorithm' => 'HMAC-SHA256'));
     unset($_REQUEST['signed_request']);
 }