I want to create a presigned url for the objects in my bucket. I use the following python code:
client = boto3.client(
's3',
aws_access_key_id=os.environ['AWS_ACCESS_KEY'],
aws_secret_access_key=os.environ['AWS_SECRETS_KEY'],
config=botocore.client.Config(signature_version='s3v4'),
region_name='eu-central-1'
)
url = client.generate_presigned_url(
ClientMethod='get_object',
ExpiresIn=60,
Params={
'Bucket': MYBUCKET,
'Key': MYKEY
})
I then send the generated URL to my frontend. On the client I will create an a tag with the generated link and use the click() method on it. This worked fine in other projects but here I only get the error:
The request signature we calculated does not match the signature you provided. Check your key and signing method.
Which is strange. The user should have all the necessary rights. Because listing all the files in my bucket works fine.
Can someone point me in the right direction why this isn't working?
EDIT
I'm using next.js on the frontend if this is of help.