コード例 #1
0
 public function testShouldReturnAValidIdToken()
 {
     $testConfig = $this->verifyIdTokenMinimal;
     $now = time();
     $origIdToken = ['aud' => $testConfig['audience'], 'iss' => $testConfig['issuer'], 'exp' => $now + 65, 'iat' => $now];
     $o = new OAuth2($testConfig);
     $alg = 'RS256';
     $jwtIdToken = $this->jwtEncode($origIdToken, $this->privateKey, $alg);
     $o->setIdToken($jwtIdToken);
     $roundTrip = $o->verifyIdToken($this->publicKey, array($alg));
     $this->assertEquals($origIdToken['aud'], $roundTrip->aud);
 }