aws / aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js
https://aws.amazon.com/developer/language/javascript/
Apache License 2.0
7.59k stars 1.55k forks source link

Correctclockskew not working as expected #4462

Closed html5js3 closed 1 year ago

html5js3 commented 1 year ago

Describe the bug

Hello,

I'm using aws-js-sdk v2.1252 and when I initialized my client, I already set correctClockSkew as true. However, I tried setting up my system clock to more than 5minutes off, and it still gave me the auth error.

Can someone advise? Thanks!

Expected Behavior

After setting correctClockSkew to true, and set system clock to more then 5 mins off, client should not get an auth error.

Current Behavior

Client still returns an error even after passing in correctClockSkew

Reproduction Steps

  1. Setup javascript library
  2. Install aws-sdk v2.1252.0
  3. Initialize sdk client with
    const GuardDutyClient =  new GuardDuty({
    correctClockSkew: true,
    region,
    credentials,
    })

Possible Solution

No response

Additional Information/Context

No response

SDK version used

2.1252

Environment details (OS name and version, etc.)

macos

RanVaknin commented 1 year ago

Hi @html5js3 ,

What is the error you are seeing?

Additionally you can log the request using the following middleware:

GuardDutyClient.middlewareStack.add(next => args => {
    console.log('before sign: ' , args.request);
    return next(args);
}, {step: 'build'})

Please paste this here and redact any sensitive information like your secretID

Thanks, Ran~

github-actions[bot] commented 1 year ago

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.