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)

demandé il y a un an542 vues
1 réponse
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
INGÉNIEUR EN ASSISTANCE TECHNIQUE
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions