Skip to content

getobjectacl api call

0

i want to get email in response of getobjectacl api call. in acl list email address must present with canonical id.

1 Answer
0

When using the GetObjectAcl API call in Amazon S3, you can indeed receive email addresses in the response, but it's important to understand how this works.

By default, the GetObjectAcl response will include the canonical user ID for AWS accounts, not email addresses. However, you can still work with email addresses in ACLs.

When you grant permissions to an AWS account using an email address, Amazon S3 will find the corresponding canonical user ID for that account and add it to the ACL. As a result, the ACL will always contain the canonical user ID of the AWS account, not the email address.

If you want to see email addresses in your ACL, you need to keep in mind that:

  1. You can grant permissions to an AWS account using an email address.
  2. When you do this, S3 will convert the email to the canonical user ID behind the scenes.
  3. In subsequent GetObjectAcl calls, you'll see the canonical user ID, not the email address.

To work around this, you would need to maintain your own mapping of email addresses to canonical user IDs. When you receive the GetObjectAcl response with canonical user IDs, you can then look up the corresponding email addresses in your mapping.

It's also worth noting that when you're setting ACLs, you can specify grantees using different types, including 'emailAddress'. However, in the ACL itself and in GetObjectAcl responses, these will be stored and returned as canonical user IDs.

Remember that while ACLs are still supported, Amazon S3 now recommends using bucket policies and IAM policies for access control in most use cases, as they provide more fine-grained control and are easier to manage at scale.
Sources
Access control list (ACL) overview - Amazon Simple Storage Service
Configuring ACLs - Amazon Simple Storage Service

answered 2 years ago

EXPERT

reviewed 2 years 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.