AWS Iot v1 updateCredentials API alternative #311
-
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. Questions. Does the V2 SDK supports automatic refresh of AWSSessionCredentials or do we need to manually do it. Older way of doing refresh
New way of refresh credentials we used.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The v2 SDK uses credentials providers and/or credentials provider chains (https://github.com/awslabs/aws-crt-java/tree/main/src/main/java/software/amazon/awssdk/crt/auth/credentials) so that you don't need to manage credential acquisition or refresh. The default provider chain (Environment -> Profile -> STS Web Identity -> ECS/IMDS) is often sufficent in many instances, but other providers exist to cover additional use cases (X509 for example). If you have a credential sourcing use case that isn't covered by the existing providers, feel free to create a discussion with a request to add support. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
The v2 SDK uses credentials providers and/or credentials provider chains (https://github.com/awslabs/aws-crt-java/tree/main/src/main/java/software/amazon/awssdk/crt/auth/credentials) so that you don't need to manage credential acquisition or refresh. The default provider chain (Environment -> Profile -> STS Web Identity -> ECS/IMDS) is often sufficent in many instances, but other providers exist to cover additional use cases (X509 for example). If you have a credential sourcing use case that isn't covered by the existing providers, feel free to create a discussion with a request to add support.