@@ -225,6 +225,7 @@ public function provideTestVerifyLogoutTokenClaimsData(): array
225225 'sid ' => 'fake-client-sid ' ,
226226 'sub ' => 'fake-client-sub ' ,
227227 'iat ' => time (),
228+ 'exp ' => time () + 300 ,
228229 'events ' => (object ) [
229230 'http://schemas.openid.net/event/backchannel-logout ' => (object )[]
230231 ],
@@ -238,6 +239,7 @@ public function provideTestVerifyLogoutTokenClaimsData(): array
238239 'sid ' => 'fake-client-sid ' ,
239240 'sub ' => 'fake-client-sub ' ,
240241 'iat ' => time (),
242+ 'exp ' => time () + 300 ,
241243 'events ' => (object ) [
242244 'http://schemas.openid.net/event/backchannel-logout ' => (object )[]
243245 ],
@@ -249,6 +251,7 @@ public function provideTestVerifyLogoutTokenClaimsData(): array
249251 'iss ' => 'fake-issuer ' ,
250252 'aud ' => [ 'fake-client-id ' , 'some-other-aud ' ],
251253 'iat ' => time (),
254+ 'exp ' => time () + 300 ,
252255 'events ' => (object ) [
253256 'http://schemas.openid.net/event/backchannel-logout ' => (object )[]
254257 ],
@@ -261,6 +264,7 @@ public function provideTestVerifyLogoutTokenClaimsData(): array
261264 'aud ' => [ 'fake-client-id ' , 'some-other-aud ' ],
262265 'sub ' => 'fake-client-sub ' ,
263266 'iat ' => time (),
267+ 'exp ' => time () + 300 ,
264268 'events ' => (object ) [
265269 'http://schemas.openid.net/event/backchannel-logout ' => (object )[]
266270 ],
@@ -273,6 +277,7 @@ public function provideTestVerifyLogoutTokenClaimsData(): array
273277 'aud ' => [ 'fake-client-id ' , 'some-other-aud ' ],
274278 'sid ' => 'fake-client-sid ' ,
275279 'iat ' => time (),
280+ 'exp ' => time () + 300 ,
276281 'events ' => (object ) [
277282 'http://schemas.openid.net/event/backchannel-logout ' => (object )[]
278283 ],
@@ -285,6 +290,7 @@ public function provideTestVerifyLogoutTokenClaimsData(): array
285290 'aud ' => [ 'fake-client-id ' , 'some-other-aud ' ],
286291 'sid ' => 'fake-client-sid ' ,
287292 'iat ' => time (),
293+ 'exp ' => time () + 300 ,
288294 'events ' => (object ) [
289295 'http://schemas.openid.net/event/backchannel-logout ' => (object )[]
290296 ],
@@ -298,6 +304,7 @@ public function provideTestVerifyLogoutTokenClaimsData(): array
298304 'aud ' => [ 'fake-client-id ' , 'some-other-aud ' ],
299305 'sid ' => 'fake-client-sid ' ,
300306 'iat ' => time (),
307+ 'exp ' => time () + 300 ,
301308 ],
302309 false
303310 ],
@@ -307,6 +314,7 @@ public function provideTestVerifyLogoutTokenClaimsData(): array
307314 'aud ' => [ 'fake-client-id ' , 'some-other-aud ' ],
308315 'sid ' => 'fake-client-sid ' ,
309316 'iat ' => time (),
317+ 'exp ' => time () + 300 ,
310318 'events ' => (object ) [],
311319 ],
312320 false
@@ -316,6 +324,7 @@ public function provideTestVerifyLogoutTokenClaimsData(): array
316324 'iss ' => 'fake-issuer ' ,
317325 'aud ' => [ 'fake-client-id ' , 'some-other-aud ' ],
318326 'sid ' => 'fake-client-sid ' ,
327+ 'exp ' => time () + 300 ,
319328 'events ' => (object ) [
320329 'http://schemas.openid.net/event/backchannel-logout ' => (object )[]
321330 ]
@@ -328,6 +337,34 @@ public function provideTestVerifyLogoutTokenClaimsData(): array
328337 'aud ' => [ 'fake-client-id ' , 'some-other-aud ' ],
329338 'sid ' => 'fake-client-sid ' ,
330339 'iat ' => time () + 301 ,
340+ 'exp ' => time () + 300 ,
341+ 'events ' => (object ) [
342+ 'http://schemas.openid.net/event/backchannel-logout ' => (object )[]
343+ ]
344+ ],
345+ false
346+ ],
347+ 'invalid-no-exp ' => [
348+ (object )[
349+ 'iss ' => 'fake-issuer ' ,
350+ 'aud ' => [ 'fake-client-id ' , 'some-other-aud ' ],
351+ 'sid ' => 'fake-client-sid ' ,
352+ 'jti ' => 'fake-client-jti ' ,
353+ 'iat ' => time (),
354+ 'events ' => (object ) [
355+ 'http://schemas.openid.net/event/backchannel-logout ' => (object )[]
356+ ]
357+ ],
358+ false
359+ ],
360+ 'invalid-bad-exp ' => [
361+ (object )[
362+ 'iss ' => 'fake-issuer ' ,
363+ 'aud ' => [ 'fake-client-id ' , 'some-other-aud ' ],
364+ 'sid ' => 'fake-client-sid ' ,
365+ 'jti ' => 'fake-client-jti ' ,
366+ 'iat ' => time (),
367+ 'exp ' => time () - 300 ,
331368 'events ' => (object ) [
332369 'http://schemas.openid.net/event/backchannel-logout ' => (object )[]
333370 ]
@@ -336,4 +373,15 @@ public function provideTestVerifyLogoutTokenClaimsData(): array
336373 ],
337374 ];
338375 }
376+
377+ public function testLeeway ()
378+ {
379+ // Default leeway is 300
380+ $ client = new OpenIDConnectClient ();
381+ $ this ->assertEquals (300 , $ client ->getLeeway ());
382+
383+ // Set leeway to 100
384+ $ client ->setLeeway (100 );
385+ $ this ->assertEquals (100 , $ client ->getLeeway ());
386+ }
339387}
0 commit comments