- Le plus récent
- Le plus de votes
- La plupart des commentaires
Hello,
From your query, I could understand that you would like to implement lambda authorizer with Appsync and understand that you are referring example code of the Lambda function from this blog [1].
Please note that, the provided example code is designed to demonstrate Appsync to Lambda authorizer integration with minimal functionality and validate a static Authorization code.
===========
const response = {
isAuthorized: authorizationToken === 'custom-authorized',
===========
Thus, you need to send static authorization code only "Authorization:custom-authorized" $ curl -XPOST -H "Content-Type:application/graphql" -H "Authorization:custom-authorized" -d '{"query": "query { listEvents { items { id } } }"}' https://YOURAPPSYNCENDPOINT/graphql
Further, to validate Bearer (JWT) Tokens in your Lambda function, you need to update the Lambda authorizer code accordingly to parse the JWT token received and validate the same as per your requirement. Additionally, I have found few third party links with examples here [2] [3]. Kindly note that, AWS does not endorse any third party link, however, this is shared only for reference purpose.
============================
Reference :
[1] https://aws.amazon.com/blogs/mobile/appsync-lambda-auth/
[2] https://github.com/mikaelvesavuori/lambda-auth-jwt-demo/blob/main/src/controllers/AuthController.ts
Contenus pertinents
- demandé il y a un an
- demandé il y a un an
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a 10 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans