From 00b8da7fb3c8bc4e5a415e18a7fae17da432a6cd Mon Sep 17 00:00:00 2001 From: Sultan Date: Wed, 3 Jul 2024 18:10:11 +0500 Subject: [PATCH] feat: get ltiMessage token --- src/Message/Payload/LtiMessagePayload.php | 7 +++++++ src/Message/Payload/LtiMessagePayloadInterface.php | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/Message/Payload/LtiMessagePayload.php b/src/Message/Payload/LtiMessagePayload.php index 4ef9341..26233be 100644 --- a/src/Message/Payload/LtiMessagePayload.php +++ b/src/Message/Payload/LtiMessagePayload.php @@ -261,4 +261,11 @@ public function getBasicOutcome(): ?BasicOutcomeClaim { return $this->getClaim(BasicOutcomeClaim::class); } + + public function getLtiTokenExpired(): bool + { + $exp = $this->getMandatoryClaim(static::CLAIM_EXP); + + return time() - $exp; + } } diff --git a/src/Message/Payload/LtiMessagePayloadInterface.php b/src/Message/Payload/LtiMessagePayloadInterface.php index 0b08dd3..e573da4 100644 --- a/src/Message/Payload/LtiMessagePayloadInterface.php +++ b/src/Message/Payload/LtiMessagePayloadInterface.php @@ -157,4 +157,6 @@ public function getAgs(): ?AgsClaim; public function getNrps(): ?NrpsClaim; public function getBasicOutcome(): ?BasicOutcomeClaim; + + public function getLtiTokenExpired(): bool; }