Skip to content
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

Clock skew not being handled by didCompleteWithError method #1077

Closed
ghost opened this issue Oct 29, 2018 · 5 comments
Closed

Clock skew not being handled by didCompleteWithError method #1077

ghost opened this issue Oct 29, 2018 · 5 comments
Labels
api gateway Issues related to API Gateway feature-request Request a new feature

Comments

@ghost
Copy link

ghost commented Oct 29, 2018

Describe the bug
When making a request on a device with wrong time, the response comes with the following error Signature not yet current: 20130909T170846Z is still later than 20130909T170823Z (20130909T170323Z + 5 min.).

To Reproduce
Steps to reproduce the behavior:

  1. Put your phone clock back 20 minutes
  2. Try to make a request to an AWSLambda instance

Which AWS service(s) are affected?
• AWSLambda

Expected behavior
When making a request on a device with wrong time, the SDK should attempt a new request with the clock skew fixed.

Screenshots
Not applicable.

Environment(please complete the following information):

  • SDK Version: 2.6.32
  • Dependency Manager: Cocoapods
  • Swift Version : Not applicable (Objective-C)

Device Information (please complete the following information):

  • Device: All devices
  • iOS Version: iOS 12.0

Additional context
When an error related to clock skew returns from the request it should call the method - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)sessionTask didCompleteWithError:(NSError *)error in order to retry the task with clock skew fixed (AWSNetworkingRetryTypeShouldCorrectClockSkewAndRetry).

@mutablealligator mutablealligator added the lambda Issues related to Lambda label Oct 30, 2018
@mutablealligator
Copy link
Contributor

@ghearly Sorry for the inconvenience. Can you post a code snippet that reproduces the issue?

@ghost
Copy link
Author

ghost commented Nov 2, 2018

@kvasukib This is the AWSAPIGatewayRequest we are using:
AWSAPIGatewayRequest *request = [[AWSAPIGatewayRequest alloc] initWithHTTPMethod:@"POST" URLString:@"/users" queryParameters:queryParameters headerParameters:_headersPOST HTTPBody:HTTPBody];

We call it like this [[[APIClient defaultClient] usersPostWithHTTPBody:HTTPBody] continueWithBlock:^id _Nullable(AWSTask * _Nonnull task) { BLOCK GOES HERE }];.

The APIClient class is generated by AWS, it works fine when the client has the correct hour and date set.

@mutablealligator mutablealligator added api gateway Issues related to API Gateway question General question labels Nov 5, 2018
@palpatim palpatim added investigating This issue is being investigated bug Something isn't working and removed question General question labels Feb 25, 2019
@palpatim
Copy link
Member

The APIGatewayClient and its API-specific subclasses use custom network handling rather than the core stack, which means that even defining a retry handler and injecting it into the API client's configuration wouldn't be respected.

The request returned from the API Gateway includes enough information that a caller could potentially inspect and retry manually, but that's not really a good solution--the SDK should do this on the client's behalf.

Because the APIGateway network stack is custom, the behavior isn't technically a bug so much as a feature gap. Therefore, I'm characterizing this as a feature request to this capability to bring this SDK into parity with other SDKs. At implementation time, we'll need to decide whether to expand the client with retry-specific custom code in both invoke methods of the API Gateway client, or migrate the APIGatewayClient networking code to use AWSCore networking.

@palpatim palpatim added feature-request Request a new feature and removed bug Something isn't working investigating This issue is being investigated lambda Issues related to Lambda labels Feb 27, 2019
@svsharsha
Copy link

We are also facing this issue. In IOS we implemented direct lambda invocation, when user changes iPads time manually got below exception
"{"message":"Signature not yet current: 20190604T152329Z is still later than 20190604T090443Z (20190604T085943Z + 5 min.)"}"
AND
"Error Domain=com.amazonaws.AWSLambdaErrorDomain Code=0 "InvalidSignatureException" UserInfo={StatusCode=403, responseStatusCode=403, message=Signature not yet }"

And there is no proper solution for Clock skew issue in IOS.
Please let us know the solution for this.

@atierian
Copy link
Member

atierian commented Dec 6, 2023

Thanks for opening this feature request. We’re closing this due to the lack of community engagement on the request.

@atierian atierian closed this as completed Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api gateway Issues related to API Gateway feature-request Request a new feature
Projects
None yet
Development

No branches or pull requests

4 participants