-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(@aws-amplify/core): AWS.config.systemClockOffset for signing requ… #4251
Conversation
0933c5a
to
2f8333b
Compare
Codecov Report
@@ Coverage Diff @@
## master #4251 +/- ##
=======================================
Coverage 78.72% 78.72%
=======================================
Files 165 165
Lines 9032 9032
Branches 1872 1820 -52
=======================================
Hits 7110 7110
- Misses 1783 1789 +6
+ Partials 139 133 -6
Continue to review full report at Codecov.
|
99f2e62
to
b3f68e3
Compare
Hi, @Amplifiyer! |
@thiagohirata thanks for submitting the PR. I have a few questions about the implementation and the intended usage.
We are also looking to migrate towards aws-sdk V3 which is in preview right now. V3 version doesn't export a global AWS variable or currently has any ways to provide a clockSkew value. This change will then need to be migrated as well when we migrate to V3 of aws-sdk. |
Hi, @Amplifiyer I am not sure if the current version of aws-sdk provides an automatic way to recalculate itself the clock skew. I will check. Making this process automatic sounds good, but I was expecting that amplify-js would follow the same behaviour as aws-sdk. This is a current issue here in Brazil - we had in two consecutive years changes in daylight saving time rules (the current rule is that there is no daylight saving time), and there is a bunch of devices with outdated databases. With users manually adjusting the time, but not changing the internal timezone offset, all signatures are automatically expired. I made a webservice myself to calculate the skew of the client. The requests made with aws-sdk work when I provide this option, but there is no way to make amplify-js work. Thanks! |
@Amplifiyer |
We found a way to calculate clock offset using aws amplify:
|
Hi @Amplifiyer!
I created a webservice that returns the server timestamp, and the client compares it with the browser's date. @dorsegal provided another way.
Maybe, but I personally think that it is better to give more alternatives to the user.
Yes, but I don't think this is a blocking reason for not merging this PR, as this solves a problem with current aws-sdk verson - don't you agree? |
Dear AWS team, Instead of searching for the perfect long term solution and consider eight different options, when you cannot come up with a solution that solves this issue better than the already ready PR, please respect your customers and their valuable time, by merging the already ready PR. Then you can always improve on the solution later when you come up with a better solution long term. This issue is potentially affecting thousands of users in the wild and developers using Amplify can spend hours individually searching for why a rare bug like this happens, while you could solve this with a click of a button. There's nothing complex about this PR in any way, so the risk of regression is about non-existent. LGTM!!! |
@houmark is absolutely correct. In my case, it is literally affecting thousands of users in a published application. Please, merge it and release ASAP. |
I'll look into this PR tomorrow and update. |
Ok, thanks @Amplifiyer |
This potentially affects a lot of AWS customers who use AWS_IAM for API authorization. |
@Amplifiyer @thiagohirata Error message is
in har file Request header
Response
|
We discussed internally how to ensure that future changes (integrating with aws-sdk-js-v3) doesn't break this, we are making small changes(#4844) to this PR to abstract out the We are working on releasing this as soon as possible. |
Hi, @Amplifiyer How to give a customized header to Sign-in screen, I have used signUpConfig for sign up screen its working fine but for the sign-in screen, it's not working, const signUpConfig = { }; export default withAuthenticator((connect(mapStateToProps, mapDispatchToProps)(App)),{ signUpConfig },true,[],null,MyTheme); I am stuck here please help thanks in advance. |
Hi everyone! I'm using amplify on a React Native application and iOS gives sometimes this 403 errors, this cannot even be resolved by a Signout and Signin! I've seen you wrote about the clockdrift problem and that you merged the fix! I'm using the latest version but it is still present! Any idea on how to solve? @dorsegal Is it still the same issue? Thank you very much! |
This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
…ests
Issue #, if available:
#2014 #3719 #3699
Description of changes:
Signer calls
AWS.util.date.getDate()
instead ofnew Date()
- making it possible to correct the signature and headers for the correct date when the system time is wrong by:By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.