OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
kreait
/
firebase-tokens
/
src
/
JWT
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:36:28 AM
rwxr-xr-x
📁
Action
-
08/12/2024 10:36:29 AM
rwxr-xr-x
📁
Cache
-
08/12/2024 10:35:46 AM
rwxr-xr-x
📁
Contract
-
08/12/2024 10:35:46 AM
rwxr-xr-x
📄
CustomTokenGenerator.php
1.88 KB
08/12/2024 10:34:14 AM
rw-r--r--
📁
Error
-
08/12/2024 10:35:46 AM
rwxr-xr-x
📄
GooglePublicKeys.php
1.32 KB
08/12/2024 10:34:14 AM
rw-r--r--
📄
IdTokenVerifier.php
2.65 KB
08/12/2024 10:34:14 AM
rw-r--r--
📁
Keys
-
08/12/2024 10:35:47 AM
rwxr-xr-x
📄
Token.php
1.35 KB
08/12/2024 10:34:14 AM
rw-r--r--
📁
Value
-
08/12/2024 10:35:47 AM
rwxr-xr-x
Editing: CustomTokenGenerator.php
Close
<?php declare(strict_types=1); namespace Kreait\Firebase\JWT; use DateInterval; use Kreait\Clock\SystemClock; use Kreait\Firebase\JWT\Action\CreateCustomToken; use Kreait\Firebase\JWT\Action\CreateCustomToken\Handler; use Kreait\Firebase\JWT\Action\CreateCustomToken\WithHandlerDiscovery; use Kreait\Firebase\JWT\Contract\Token; use Kreait\Firebase\JWT\Error\CustomTokenCreationFailed; use Kreait\Firebase\JWT\Value\Duration; final class CustomTokenGenerator { private Handler $handler; private ?string $tenantId = null; public function __construct(Handler $handler) { $this->handler = $handler; } public static function withClientEmailAndPrivateKey(string $clientEmail, string $privateKey): self { $handler = new WithHandlerDiscovery($clientEmail, $privateKey, new SystemClock()); return new self($handler); } public function withTenantId(string $tenantId): self { $generator = clone $this; $generator->tenantId = $tenantId; return $generator; } public function execute(CreateCustomToken $action): Token { if ($this->tenantId) { $action = $action->withTenantId($this->tenantId); } return $this->handler->handle($action); } /** * @param array<string, mixed> $claims * @param Duration|DateInterval|string|int $timeToLive * * @throws CustomTokenCreationFailed */ public function createCustomToken(string $uid, array $claims = null, $timeToLive = null): Token { $action = CreateCustomToken::forUid($uid); if ($claims !== null) { $action = $action->withCustomClaims($claims); } if ($timeToLive !== null) { $action = $action->withTimeToLive($timeToLive); } return $this->execute($action); } }