awslabs / aws-mobile-appsync-sdk-js

JavaScript library files for Offline, Sync, Sigv4. includes support for React Native
Apache License 2.0
919 stars 266 forks source link

I can't setClockOffset for resolve 'Signature not yet current' - correctClockSkew #620

Open ktoala opened 3 years ago

ktoala commented 3 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? when use AWSAppSyncClient with auth AWS_IAM I get the next error when execute query Signature not yet current: 20210205T063224Z is still later than 20210205T062625Z (20210205T062125Z + 5 min.)

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Change your clock manually by over 5 minutes in the past or future.

What is the expected behavior? In AWS Amplify for JS I can use the next code and the problem is resolved. Auth.currentAuthenticatedUser({bypassCache: true}) .then(user => DateUtils.setClockOffset(-(user.signInUserSession.clockDrift * 1000))) .catch(() => {}); But when use aws-mobile-appsync-sdk-js. It's doesn't work

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions? browser, ionic + capacitor

I was review the code and I think the problem is here because I can't set clock offset like DateUtils.setClockOffset of AWS Amplify.

This issue has affected our customers and was a difficult issue to detect in production.

danielvouch commented 1 year ago

@ktoala Any update on this by any chance??