我试图了解当用户发出经过身份验证的请求时,我可以从 API 网关访问哪些可用声明。
API 网关映射模板参考 (https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference) 列出了不同的授权者声称但看起来只有“子”和“电子邮件”有效。
所有其他声明均记录为“-”
我正在使用 CloudWatch 记录请求,如本指南中所述: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html
我也想获取用户名,但以下映射都不起作用:
要查看所有可用属性的列表,您可以临时将其添加到映射模板中:
$context.authorizer.claims.keySet()
。