Skip to content

Add details for AppSync IAM auth regarding $context.indentity.cognitoIdentityId #2898

Open
@JeremyJonas

Description

@JeremyJonas

Is your feature request related to a problem? Please describe.
The GraphQL Auth docs does not specify any details around AUTH_TYPE.AWS_IAM being required to get $context.indentity.congnitoIdentityId during AppSync resolvers.

When using a Cognito User Pool with Federated Identity, and following the cognito s3 access docs, there is no mention that to have this value in your resolvers you must use IAM auth and would assume the use of AMAZON_COGNITO_USER_POOLS.

The reference I have found for this detail is from a forum post - https://forums.aws.amazon.com/thread.jspa?threadID=292671

Describe the solution you'd like
Add doc/guide describing how to get $context.identity.cognitoIdentityId in AppSync resolvers.

Reference that material in:

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
When using the IAM policy for cognito user access to s3 buckets based on cognito identity (example) the resolvers for your AppSync API need to be able to retrieve this information from the request in order to perform actions on behalf of users.

  • DynamoDB data based on cognitoIdenityId
  • ElasticSearch data based on cognitoIdenityId
  • S3 bucket based on cognitoIdenityId
  • ...

Searching google produces confusion in this area

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions