Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439 Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
40 lines
794 B
PHP
40 lines
794 B
PHP
<?php
|
|
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
namespace Chamilo\PluginBundle\Zoom\API;
|
|
|
|
use Firebase\JWT\JWT;
|
|
|
|
/**
|
|
* Class JWTClient.
|
|
*
|
|
* @see https://marketplace.zoom.us/docs/guides/auth/jwt
|
|
*/
|
|
class JWTClient extends Client
|
|
{
|
|
use Api2RequestTrait;
|
|
|
|
public $token;
|
|
|
|
/**
|
|
* JWTClient constructor.
|
|
* Requires JWT app credentials.
|
|
*
|
|
* @param string $apiKey JWT API Key
|
|
* @param string $apiSecret JWT API Secret
|
|
*/
|
|
public function __construct($apiKey, $apiSecret)
|
|
{
|
|
$this->token = JWT::encode(
|
|
[
|
|
'iss' => $apiKey,
|
|
'exp' => (time() + 60) * 1000, // will expire in one minute
|
|
],
|
|
$apiSecret,
|
|
'HS256'
|
|
);
|
|
self::register($this);
|
|
}
|
|
}
|