Ejemplo n.º 1
0
 public function testGeneratesAssertionRequests()
 {
     $testConfig = $this->tokenRequestMinimal;
     $o = new OAuth2($testConfig);
     $o->setSigningKey('a_key');
     $o->setSigningAlgorithm('HS256');
     // Generate the request and confirm that it's correct.
     $req = $o->generateCredentialsRequest();
     $this->assertInstanceOf('Psr\\Http\\Message\\RequestInterface', $req);
     $this->assertEquals('POST', $req->getMethod());
     $fields = Psr7\parse_query((string) $req->getBody());
     $this->assertEquals(OAuth2::JWT_URN, $fields['grant_type']);
     $this->assertTrue(array_key_exists('assertion', $fields));
 }