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)

질문됨 일 년 전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
지원 엔지니어
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠