GetSecretValueResponse not working to retrieve secret values

0

I am manually uploading the aws credentials file which contains access key , secret key, session token and many more. I am trying to fetch the secret values in my secret manager through java code. Currently i am using GetSecretValueResponse for fetching the values and AWSCredsProvider(access key, secret key) as my credentials provider. It is expecting it to be instanceof AwsSessionCredentials( access key , secret key, session token) but this is a final class, So how can I make my java code utilize the session token that is being provided in the file that I uploaded initially?

<dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>secretsmanager</artifactId> <version>2.20.22</version> </dependency>

dependancy that i have used.

ERROR: The security token included in the request is invalid. (Service: SecretsManager, Status Code: 400, Request ID: 7b4d76ea-389f-4068-8fde-577224a67f5c)

已提问 1 年前538 查看次数
1 回答
0

Hi,

Thank you for contacting us. Please note that this error message can appear if the expected credentials are not used appropriately. As an example, if your intention is to use temporary credentials, but you have configured your system to use only the access key and secret access key, without the session token value.

Please feel free to refer to the following documentation to identify how you may pass temporary credentials for use with AWS Java SDK:

The documentation contains details for specifying a credential provider or provider chain.

Feel free to reach back with any questions!

AWS
支持工程师
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容