Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
AWS S3 V3 Error trying to get list of objects inside a bucket. SignatureDoesNotMatch

I have Reactjs project created using create-react-app and a aws s3 bucket in witch I've saved some images that I want to display on my website.

I have created a aws.js where I configure and make the call like this

import { S3Client } from "@aws-sdk/client-s3";
import { ListObjectsV2Command } from "@aws-sdk/client-s3";

const REGION  = 'eu-central-1'

const credentials = {
    accessKeyId: accessKeyId,
    privateKeyId: privateKeyId,
}

const config = {
    region: REGION,
    credentials: credentials,
}

const bucketName = {
    Bucket: bucketName,
}

const s3Client = new S3Client(config);

export const run = async () => {
    try{
        const command = new ListObjectsV2Command(bucketName);
        const data = await s3Client.send(command);
        console.log("SUCCESS\n", data);
    }
    catch(err) {
        console.log("ERROR\n", err);
    }
}

I have also created a .env filder where I saved the keys with and without REACT_APP prefix but the result is the same. Invalidating the credentials.

For credentials I've checked and rechecked 10 times and I also created a new user and use those keys but nothing. I also configured CORS to allow access from my localhost.

What I'm doing wrong? And is there a complete documentation from A-Z on what to use AWS services? Including v3, api doc, credentials set up and everything.

P.S. It's my first time using AWS so some docs would be much apreciated. Thanks in advance

UPDATE--- I tried to use aws javascript sdk v2 and now it works. Here is the code that I used to list objects inside a bucket

But it works only when I used AWS.config.update if I passed the configuration to the bucket it still thrown an error

const AWS = require('aws-sdk');

AWS.config.update({
    region: region,
    accessKeyId: accessKeyId,
    secretAccessKey: secretAccessKey
});

let s3 = new AWS.S3()

export const testFnc = () =>{
    s3.listObjects({
        Bucket: 'artgalleryszili.digital'
    }, (res, err) => {
        if(err){
            console.log(err);
        }
        else{
            console.log(res);
        }
    })
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda