ILIAS  release_8 Revision v8.23
Jwt.php
Go to the documentation of this file.
1 <?php
2 
20 
22 
30 class Jwt
31 {
37  public static int $life = 60;
38 
44  public static int $leeway = 180;
45 
51  public static bool $allowJkuHeader = false;
52 
58  private static ?ClientInterface $jwtClient = null; //changed ... = null
59 
63  public function __construct()
64  {
65  }
66 
74  public static function setJwtClient(\ILIAS\LTI\ToolProvider\Jwt\ClientInterface $jwtClient = null)
75  {
76  self::$jwtClient = $jwtClient;
77  Util::logDebug('JwtClient set to \'' . get_class(self::$jwtClient) . '\'');
78  }
79 
85  public static function getJwtClient()
86  {
87  if (empty(self::$jwtClient)) { //changed
88  self::$jwtClient = new FirebaseClient();
89  Util::logDebug('JwtClient set to \'' . get_class(self::$jwtClient) . '\'');
90  }
91  return self::$jwtClient;
92  }
93 }
static bool $allowJkuHeader
Allow use of jku header in JWT.
Definition: Jwt.php:51
static logDebug(string $message, bool $showSource=false)
Log a debug message.
Definition: Util.php:363
Class ChatMainBarProvider .
static int $leeway
Leeway (in seconds) to allow when checking timestamps (default is 3 minutes).
Definition: Jwt.php:44
static setJwtClient(\ILIAS\LTI\ToolProvider\Jwt\ClientInterface $jwtClient=null)
Set the JWT client to use for handling JWTs.
Definition: Jwt.php:74
Class to implement the JWT interface using the Firebase JWT library from https://github.com/firebase/php-jwt.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static int $life
Life (in seconds) of an issued JWT (default is 1 minute).
Definition: Jwt.php:37
static ClientInterface $jwtClient
The client used to handle JWTs.
Definition: Jwt.php:58
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct()
Class constructor.
Definition: Jwt.php:63
Class to represent an HTTP message request.
Definition: Jwt.php:30
static getJwtClient()
Get the JWT client to use for handling JWTs.
Definition: Jwt.php:85
Interface to represent an HWT client.