简体   繁体   中英

How to pass and read authorization bearer-token using python lambda function through api gateway?

I have a python lambda function that I want to decode and read the payload of a jwt. I created a get method and passing the authorization bearer-token to the endpoint. How can i pass and read the jwt using lambda function through api gateway?

You can utilise the mapping template of method integration section. The mapping template utlises velocity template for creating the event. You can capture the headers and send them in the event.

Refer https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html

After invocation of lambda function, the JWT token can be captured in the event and you can retreive the payload.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM