1

I received the sts credential from the server and using it to create an s3 object and upload it.

// aws sdk v2
// STS credentials
//{aws_access_key_id,  aws_secret_access_key, aws_session_token, basepath, bucket_name, bucket_region, acl, expires_at}

const s3 = new AWS.S3();

  s3.config.update({
                        'region': region, 
                        'accessKeyId': accessKeyId,
                        'secretAccessKey' : secretAccessKey,
                        'sessionToken': sessionToken,
                        'credentials': credentials, 
                        'correctClockSkew': true
                    }
...

s3.upload()...

The provided token has expired ...

Because the file size was very large, an expiration error occurred if the upload could not be completed within the expiration time. The server side cannot increase the expiration time.

The only thing I can do in this situation is to obtain an STS again for the basepath of the same bucket.

Is there a way to insert the reissued STS in the middle of upload? I tried everything but failed. Or is there a way to force the credential provider to naturally refresh and retry between uploads?

1
  • Related question with SDK v3 here. Commented Jan 17, 2024 at 16:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.