AWS Api网关授权者+ Cognito用户池不起作用{“消息”:“未经授权”} [英] AWS Api Gateway Authorizer + Cognito User Pool Not Working {"message": "Unauthorized"}
问题描述
我正在尝试将aws api网关授权者与cognito用户池一起使用。当我使用AWS API网关控制台进行测试时,它工作正常。
I am trying to use aws api gateway authorizer with cognito user pool. It is working fine when i test using aws api gateway console.
但是当我尝试在api中启用授权时,它会显示 message: Unauthorized。
请检查下面的屏幕截图
But when i try enabling the authorization in the api it says "message": "Unauthorized".
Please check below screenshot
API网关控制台屏幕截图-可以正常使用
API Gateway Console Screenshot - This works fine
邮递员屏幕截图-不起作用
Postman Screen shot - Not working
有人可以帮忙吗?
仅供参考,我已按照此处提到的说明进行操作 http://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html
FYI I have followed the instructions as mentioned here http://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html
推荐答案
就我而言,授权代码s应该是 id_token
。我误用了 access_token
In my case, authorization code should be id_token
. I made a mistake for using access_token
instead
这篇关于AWS Api网关授权者+ Cognito用户池不起作用{“消息”:“未经授权”}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!