AWS Iot v1 updateCredentials API alternative


In v1 SDK for java we uses mqttClient updateCredentials API to refresh the credentials post expiration, But in V2 sdk we dont have UpdateCredentials API, so we did manual disconnect and used refreshed AwsSessionCredentials to create a new mqttClient and maps it to the old MQttWrapper. For creating the new client we uses AwsIotMqttConenctionBuilder which takes CredentialsProvider.


  1. Does the V2 SDK supports automatic refresh of AWSSessionCredentials or do we need to manually do it.
  2. If we need to do it manually Is there any way other than manual disconnect and connect again.
  3. As the manual disconnect and connect can cause intermittent issues and Latency issue do we have any other alternative for it.
asked 3 months ago36 views
1 Answer

Hi. The V2 IoT Device SDKs are all built on top of the AWS Common Runtime. The aws-c-auth module handles the credentials provider. The provider chains that source session credentials handle refreshing internally.

For instance, you can see the setup of the refreshing here:

profile picture
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions