Accessing an S3 Bucket in Java Spring Boot Using a Cognito User Token


Hello, I am developing a Java Spring Boot application and I'm looking to carry out AWS S3 operations, such as reading objects, uploading files, and creating folders within a bucket. Is it feasible to perform these operations using a Cognito user JWT token? Your assistance would be greatly appreciated. Thank you.

1 Answer

You'd need to use the Cognito Identity Pool. An Amazon Cognito identity pool is a directory of federated identities that you can exchange for AWS credentials. Amazon Cognito identities are exchanged for credentials using web identity federation support in the AWS Security Token Service (AWS STS). The recommended way to obtain AWS credentials for your app users is to use AWS.CognitoIdentityCredentials. The identity in the credentials object is then exchanged for credentials using AWS STS.

See the blog post series:

answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions