Closed mrtj closed 1 year ago
The expiration interval of session credentials has no effect on a sigv4-signed websocket connection to AWS IoT Core. Credentials will only be refreshed when existing ones have expired and a new connection needs to be established.
I have temporary STS credentials and I am trying to implement a delegate credentials provider setting the
expiration
field of the returnedAwsCredentials
. I would expect that before the declared expiration of the credentials, the authorization implementation of aws-crt calls my delegate back for new credentials, however this does not happen. I plan to use the credential provider for a websocket based mqtt client from awsiot library.I would expect the
credentials_factory was called!
line to be printed every time when the credentials expire and should be renewed (in the snippet above once in every 5 minutes). Instead, aws-crt calls my delegate only once, at the beginning of the connection. When the token indeed expires (as reported back by the server), myon_connection_interrupted
callback is called with a "AWS_ERROR_MQTT_UNEXPECTED_HANGUP" error, and then it tries to build back the connection. But I would prefer to prevent this situation and provide a new token before the old one expires.