Search code examples
javaamazon-web-servicesaws-sdkamazon-iamaws-sts

Why AmazonSTSCredentialsProvider is only in mobile SDK and not in aws-java-sdk


I am working with AWS Assume role access logic. For that I am trying to get new temporary credentials before previous one is expired.

I found AmazonSTSCredentialsProvider is doing this logic. But this is present ony in mobile SDK not in java SDK. Is there any reason that java SDK doesn't have this class or Is Java SDK has some other provider to do this temporary credential refreshment.


Solution

  • The AWS Java SDK offers a wide variety of implementations of the AWSCredentialsProvider Interface - for your use case, I assume you'd want to look into the STSSessionCredentialsProvider and/or the STSAssumeRoleSessionCredentialsProvider.

    As for reasons on the differences between SDKs - I'm not too familiar with the mobile SDK and thus have no idea why there would be different class namings/offerings there.