Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Oct 17, 2023
1 parent 97cac28 commit 64ac6eb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/OAuth2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1250,8 +1250,14 @@ public function testShouldReturnAValidIdToken()
$alg = 'RS256';
$jwtIdToken = JWT::encode($origIdToken, $privateKey, $alg);
$o->setIdToken($jwtIdToken);

// Test with array alg
$roundTrip = $o->verifyIdToken($publicKey, [$alg]);
$this->assertEquals($origIdToken['aud'], $roundTrip->aud);

// Test with string alg
$roundTrip2 = $o->verifyIdToken($publicKey, $alg);
$this->assertEquals($origIdToken['aud'], $roundTrip2->aud);
}
}

Expand Down

0 comments on commit 64ac6eb

Please sign in to comment.