Skip to content

Signature V4 requires AWS credentials for request signing #252

Open
@jack20211101

Description

@jack20211101

Describe the bug

I configured [AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY] in .env, and S3Client can be called normally in Windows, but it prompts in Linux: vendor/aws/aws-sdk-php/src/Auth/AuthSchemeResolver.php",85,"Could not resolve an authentication scheme: Signature V4 requires AWS credentials for request signing, I don’t understand why.
Use the following method to work properly:

use Aws\S3\S3Client;
use Aws\Credentials\Credentials;

$credentials = new Credentials('your-access-key-id', 'your-secret-access-key');

$s3Client = new S3Client([
'version' => 'latest',
'region' => 'us-east-1',
'credentials' => $credentials,
]);

In addition, the published configuration file config/aws.php
AWS_REGION should be AWS_DEFAULT_REGION in laravel

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

I hope the configuration reads correctly

Current Behavior

Now, except for the prompt, there is no other

Reproduction Steps

In Linux, it is bound to happen. The OS is AWS Linux 2023

Possible Solution

No response

Additional Information/Context

No response

SDK version used

3.342.4

Environment details (OS name and version, etc.)

Linux 6.1.129-138.220.amzn2023.x86_64

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions