1 Answer
- Newest
- Most votes
- Most comments
0
A user (logged in) sends a request to: https://<my-bucket-endpoint>/some-folder/some-file
Since your authorization need some additional information from external DynamoDB other than your Cognito tokens (i.e., access token or ID token), it is not feasible to use IAM policy (IAM role or bucket policy) to grant access permission.
Instead, you need to create an API to authorize the request (based on tokens and data from DynamoDB). If the request is authorized, you generate a presigned URL and redirect users to that URL with 302 response. Otherwise, you return client errors like 403 or 401.
answered 2 years ago
Relevant content
- asked 2 years ago
- asked 4 years ago
