title: How to pass cognito authentication token in the headers through api gateway to a lambda function
body: <p>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:</p>
  <pre><code>          Axios.get(`url`, {
                  headers: {
                      'Authorization': Token
                  }
              })
  </code></pre>
  <p>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?</p>
  <pre><code>{
    
    &quot;idToken&quot;:&quot;$context.authorizer.claims.authorization&quot;
  }
  </code></pre>