我拥有可以完全访问Bucket的亚马逊帐户 和下一个请求:
$credentials = new Credentials('*****', '***');
$sts = StsClient::factory([
'version' => 'latest',
'region' => '*****',
'credentials' => $credentials
]);
$credentials = $sts->getSessionToken()->get('Credentials');
$s3Client = new Aws\S3\S3Client([
'version' => 'latest',
'region' => '*******',
'credentials' => $credentials
]);
$cmd = $s3Client->getCommand('GetObject', [
'Bucket' => '******',
'Key' => $src,
'SSECustomerAlgorithm' => 'AWS4-HMAC-SHA256',
'x-amz-server-side-encryption' => 'AES256',
]);
$request = $s3Client->createPresignedRequest($cmd, '+20 minutes');
$presignedUrl = (string) $request->getUri();
但我总是得到下一个错误
无效令牌