Aws-sdk-android: AWS IoT: 403 response when the device time is out of sync

Created on 26 Mar 2019  路  4Comments  路  Source: aws-amplify/aws-sdk-android

Describe the bug
When I try to connect to the AWS using AwsIotMqttManager and the device time is out of sync, I'm getting the 403 response. Setting time offset using SDKGlobalConfiguration.setGlobalTimeOffset() doesn't affect this.

To Reproduce

  1. Disable device's automatic time setting and set time to 10 minutes off
  2. Try connecting to AWS using AwsIotMqttManager

Which AWS service(s) are affected?
AWS IoT

Expected behavior
Adding the global time offset should work with IoT

Environment Information (please complete the following information):

  • AWS Android SDK Version: aws-android-sdk-iot:2.12.5
  • Device: Pixel 2 XL
  • Android Version: Pie 9
  • Specific to simulators: No

Additional context
It seems that AwsIotMqttManager uses System.currentTimeMillis() when generating the signed AwsIoT websocket url.

Bug IoT Needs Info from Requester

All 4 comments

Hi @slomin ,

I'm marking this as a feature request because we might not have this ability. I have tagged @desokroshan to investigate further.

@slomin This has been fixed in the latest release 2.12.7. Could you please update to the latest and confirm. Thanks!

It works now, @desokroshan thank you for the quick fix!

Good to hear that. Thanks for the confirmation!

Was this page helpful?
0 / 5 - 0 ratings