A Lambda Authorizer configured like in the Authorizer guide can help integrate Supertokens with an AppSync service.
Set up the AppSync service with an API key authorization. For more details, please see the AWS documentation.
When setting up the POST method on
/graphql, you should use the following settings:
- Integration type: AWS service
- AWS Region: the region of the AppSync service
- AWS Service: AppSync Data Plane
- AWS Subdomain: the part of the domain of the GraphQL service before
- HTTP method: POST
- Action type: Use path override
- Path override:
- Execution role: the ARN of an execution role that is authorized to call the AppSync service (e.g.:
Configure the "Integration Request" of the
/graphql POST method.
- "x-api-key": The API key of the App Sync service, wrapped in single quotes.
context.authorizer.principalId, without quotes.
You can access the headers you mapped above in resolvers through the context. (e.g., $context.request.headers.custom) For more information, please see the resolver context docs.