-
Notifications
You must be signed in to change notification settings - Fork 221
Description
Is your feature request related to a problem? Please describe.
I am currently migrating an iOS app from the AWS SDK for iOS to Amplify for Swift. The conversion was really easy and smooth, and I'm loving the new API. Before the final push, I was going through my standard tests when I noticed a failure. There is a test case I run that manually sets the iPhone time beyond 5 minutes from the current time and the AWSAPIPlugin requests get rejected due to excessive clock skew (I get a 403 with InvalidSignatureException
) on the initial request and the retry. When we were using the old SDK, I was able to calculate the offset from the error message from the server and manually set an offset that would get used and negate whatever weird time change the user felt like imposing. I am not seeing an equivalent work around in Amplify for Swift. I was using NSDate.aws_setRuntimeClockSkew to manage this issue in the old SDK. I am able to grab the server time from the error response and calculate the offset, but I have no way to apply it to the API calls, I need a way to apply this offset to the API calls.
Describe the solution you'd like
I'd like to see a way to manually (or automatically) adjust for larger time differences between the server and the user's device in Amplify for Swift. Whether that is in the RESTRequest body or headers, or a function call within Amplify I do not have a preference.
Describe alternatives you've considered
I've tried experimenting with timestamp fields in headers and request bodies, but nothing I tried fixed the issue.
Is the feature request related to any of the existing Amplify categories?
API
Additional context
No response