From 64ac6eb985e0554eeae27f457e96e52f31717c23 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 17 Oct 2023 12:13:10 -0700 Subject: [PATCH] add test --- tests/OAuth2Test.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/OAuth2Test.php b/tests/OAuth2Test.php index 8de3f35b9..e00ab647f 100644 --- a/tests/OAuth2Test.php +++ b/tests/OAuth2Test.php @@ -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); } }