我使用AWS Identity Pool和Facebook提供商来验证客户端。我需要使用Api Gateway调用AWS Lambda。从Cognito,使用Facebook令牌,我收到了凭证:AccessKeyId,SecretKey和SessionToken。
使用此凭据,我应该如何设置标头请求来调用我的Lambda?
Api Gateway设置(测试调用我的lambda)
我尝试调用我的api,它返回“请求中包含的安全令牌无效。”
谢谢!
答案 0 :(得分:3)
请为邮递员试试这个:
http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-use-postman-to-call-api.html
在“授权”下拉列表中选择 AWS签名选项,并使用密钥和密码填写字段,单击“更新”。邮递员将为您签署请求。
并确保分配给您的cognito用户的角色可以访问调用apig。
答案 1 :(得分:2)
您必须手动设置' x-amz-security-token '在Postman中并传递该标题中的标记。
答案 2 :(得分:2)