maxAge = $maxAge; $this->allowedTimeDrift = $allowedTimeDrift; $this->clock = $clock ?? new InternalClock(); } /** * @throws InvalidClaimException */ public function checkClaim(mixed $value): void { if (! is_int($value)) { throw new InvalidClaimException('"auth_time" must be an integer.', self::CLAIM_NAME, $value); } if ($value + $this->maxAge < $this->clock->now()->getTimestamp() - $this->allowedTimeDrift) { throw new InvalidClaimException('Too much time has elapsed since the last End-User authentication.', self::CLAIM_NAME, $value); } } public function supportedClaim(): string { return self::CLAIM_NAME; } }