OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
kreait
/
firebase-php
/
src
/
Firebase
/
Auth
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:35:39 AM
rwxr-xr-x
📁
ActionCodeSettings
-
08/12/2024 10:36:25 AM
rwxr-xr-x
📄
ActionCodeSettings.php
208 bytes
08/12/2024 10:35:36 AM
rw-r--r--
📄
ApiClient.php
6.1 KB
08/12/2024 10:35:36 AM
rw-r--r--
📁
CreateActionLink
-
08/12/2024 10:36:25 AM
rwxr-xr-x
📄
CreateActionLink.php
1.37 KB
08/12/2024 10:35:36 AM
rw-r--r--
📁
CreateSessionCookie
-
08/12/2024 10:36:25 AM
rwxr-xr-x
📄
CreateSessionCookie.php
2.21 KB
08/12/2024 10:35:36 AM
rw-r--r--
📄
CustomTokenViaGoogleIam.php
3.16 KB
08/12/2024 10:35:36 AM
rw-r--r--
📄
DeleteUsersRequest.php
1.69 KB
08/12/2024 10:35:36 AM
rw-r--r--
📄
DeleteUsersResult.php
1.66 KB
08/12/2024 10:35:36 AM
rw-r--r--
📄
DisabledLegacyCustomTokenGenerator.php
659 bytes
08/12/2024 10:35:36 AM
rw-r--r--
📄
DisabledLegacyIdTokenVerifier.php
505 bytes
08/12/2024 10:35:36 AM
rw-r--r--
📄
IdTokenVerifier.php
4.57 KB
08/12/2024 10:35:36 AM
rw-r--r--
📄
IsTenantAware.php
147 bytes
08/12/2024 10:35:36 AM
rw-r--r--
📁
SendActionLink
-
08/12/2024 10:36:25 AM
rwxr-xr-x
📄
SendActionLink.php
1.78 KB
08/12/2024 10:35:36 AM
rw-r--r--
📁
SignIn
-
08/12/2024 10:36:25 AM
rwxr-xr-x
📄
SignIn.php
96 bytes
08/12/2024 10:35:36 AM
rw-r--r--
📄
SignInAnonymously.php
571 bytes
08/12/2024 10:35:36 AM
rw-r--r--
📄
SignInResult.php
3.77 KB
08/12/2024 10:35:36 AM
rw-r--r--
📄
SignInWithCustomToken.php
821 bytes
08/12/2024 10:35:36 AM
rw-r--r--
📄
SignInWithEmailAndOobCode.php
973 bytes
08/12/2024 10:35:36 AM
rw-r--r--
📄
SignInWithEmailAndPassword.php
1.03 KB
08/12/2024 10:35:36 AM
rw-r--r--
📄
SignInWithIdpCredentials.php
2.75 KB
08/12/2024 10:35:36 AM
rw-r--r--
📄
SignInWithRefreshToken.php
828 bytes
08/12/2024 10:35:36 AM
rw-r--r--
📄
TenantId.php
421 bytes
08/12/2024 10:35:37 AM
rw-r--r--
📄
UserInfo.php
1.11 KB
08/12/2024 10:35:37 AM
rw-r--r--
📄
UserMetaData.php
1.63 KB
08/12/2024 10:35:37 AM
rw-r--r--
📄
UserRecord.php
3.6 KB
08/12/2024 10:35:37 AM
rw-r--r--
Editing: ApiClient.php
Close
<?php declare(strict_types=1); namespace Kreait\Firebase\Auth; use GuzzleHttp\ClientInterface; use Kreait\Firebase\Exception\Auth\EmailNotFound; use Kreait\Firebase\Exception\Auth\ExpiredOobCode; use Kreait\Firebase\Exception\Auth\InvalidOobCode; use Kreait\Firebase\Exception\Auth\OperationNotAllowed; use Kreait\Firebase\Exception\Auth\UserDisabled; use Kreait\Firebase\Exception\AuthApiExceptionConverter; use Kreait\Firebase\Exception\AuthException; use Kreait\Firebase\Request; use Kreait\Firebase\Util\JSON; use Psr\Http\Message\ResponseInterface; use Throwable; /** * @internal */ class ApiClient { private ClientInterface $client; private ?TenantId $tenantId; private AuthApiExceptionConverter $errorHandler; /** * @internal */ public function __construct(ClientInterface $client, ?TenantId $tenantId = null) { $this->client = $client; $this->tenantId = $tenantId; $this->errorHandler = new AuthApiExceptionConverter(); } /** * @throws AuthException */ public function createUser(Request\CreateUser $request): ResponseInterface { return $this->requestApi('signupNewUser', $request->jsonSerialize()); } /** * @throws AuthException */ public function updateUser(Request\UpdateUser $request): ResponseInterface { return $this->requestApi('setAccountInfo', $request->jsonSerialize()); } /** * @param array<string, mixed> $claims * * @throws AuthException */ public function setCustomUserClaims(string $uid, array $claims): ResponseInterface { return $this->requestApi('https://identitytoolkit.googleapis.com/v1/accounts:update', [ 'localId' => $uid, 'customAttributes' => JSON::encode((object) $claims), ]); } /** * Returns a user for the given email address. * * @throws EmailNotFound * @throws AuthException */ public function getUserByEmail(string $email): ResponseInterface { return $this->requestApi('getAccountInfo', [ 'email' => [$email], ]); } /** * @throws AuthException */ public function getUserByPhoneNumber(string $phoneNumber): ResponseInterface { return $this->requestApi('getAccountInfo', [ 'phoneNumber' => [$phoneNumber], ]); } /** * @throws AuthException */ public function downloadAccount(?int $batchSize = null, ?string $nextPageToken = null): ResponseInterface { $batchSize ??= 1000; return $this->requestApi('downloadAccount', \array_filter([ 'maxResults' => $batchSize, 'nextPageToken' => $nextPageToken, ])); } /** * @throws AuthException */ public function deleteUser(string $uid): ResponseInterface { return $this->requestApi('deleteAccount', [ 'localId' => $uid, ]); } /** * @param string[] $uids * * @throws AuthException */ public function deleteUsers(string $projectId, array $uids, bool $forceDeleteEnabledUsers, ?string $tenantId = null): ResponseInterface { $data = [ 'localIds' => $uids, 'force' => $forceDeleteEnabledUsers, ]; if ($tenantId) { $data['tenantId'] = $tenantId; } return $this->requestApi( "https://identitytoolkit.googleapis.com/v1/projects/{$projectId}/accounts:batchDelete", $data ); } /** * @param string|array<string> $uids * * @throws AuthException */ public function getAccountInfo($uids): ResponseInterface { if (!\is_array($uids)) { $uids = [$uids]; } return $this->requestApi('getAccountInfo', [ 'localId' => $uids, ]); } /** * @throws ExpiredOobCode * @throws InvalidOobCode * @throws OperationNotAllowed * @throws AuthException */ public function verifyPasswordResetCode(string $oobCode): ResponseInterface { return $this->requestApi('resetPassword', [ 'oobCode' => $oobCode, ]); } /** * @throws ExpiredOobCode * @throws InvalidOobCode * @throws OperationNotAllowed * @throws UserDisabled * @throws AuthException */ public function confirmPasswordReset(string $oobCode, string $newPassword): ResponseInterface { return $this->requestApi('resetPassword', [ 'oobCode' => $oobCode, 'newPassword' => $newPassword, ]); } /** * @throws AuthException */ public function revokeRefreshTokens(string $uid): ResponseInterface { return $this->requestApi('setAccountInfo', [ 'localId' => $uid, 'validSince' => \time(), ]); } /** * @param array<int, \Stringable|string> $providers * * @throws AuthException */ public function unlinkProvider(string $uid, array $providers): ResponseInterface { $providers = \array_map('strval', $providers); return $this->requestApi('setAccountInfo', [ 'localId' => $uid, 'deleteProvider' => $providers, ]); } /** * @param array<mixed> $data * * @throws AuthException */ private function requestApi(string $uri, array $data): ResponseInterface { $options = []; $tenantId = $data['tenantId'] ?? $this->tenantId ?? null; $tenantId = $tenantId instanceof TenantId ? $tenantId->toString() : $tenantId; if ($tenantId) { $data['tenantId'] = $tenantId; } if (!empty($data)) { $options['json'] = $data; } try { return $this->client->request('POST', $uri, $options); } catch (Throwable $e) { throw $this->errorHandler->convertException($e); } } }