I am working on a full-stack project. And I use AWS cognito to do the Authentication part. And on my front-end, I can get the idToken successfully and put into the method headers. Here is the get method code:
Axios.get(`url`, {
headers: {
'Authorization': Token
}
})
On the backend, I use AWS api gateway and lambda. As I understand, if I want to get the token in the lamdba, I have to set up the mapping template in the Integration Request of APIgateway. So here is what I write, but I can't get the idToken. Anyone knows the correct way to get the idToken?
{
"idToken":"$context.authorizer.claims.authorization"
}