title: How to log all Cognito User details in API Gateway Cloudwatch
body: <p>I'm trying to understand what are the available claims I am able to access from the API Gateway when an user makes an authenticated request.</p>
  
  <p>The API Gateway Mapping Template Reference (<a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference" rel="noreferrer">https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference</a>) is listing different authorizer claims but it looks like only "sub" and "email" work.</p>
  
  <p>All the other claims are logged as "-"</p>
  
  <p>I'm logging the requests with CloudWatch, as described in this guide:
  <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html" rel="noreferrer">https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html</a></p>
  
  <p>I would like to get the username too but none of the following mapping work:</p>
  
  <ul>
  <li>$context.authorizer.claims['cognito:username']</li>
  <li>$context.authorizer.claims\['cognito:username'\]</li>
  <li>$context.identity.cognitoIdentityId</li>
  </ul>