AWS Api Gateway Authorizer + Cognito User Pool Not Working {“message": “Unauthorized"} [英] AWS Api Gateway Authorizer + Cognito User Pool Not Working {"message": "Unauthorized"}

查看:48
本文介绍了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

推荐答案

就我而言,授权码应该是 id_token.我错误地使用了 access_token 代替

In my case, authorization code should be id_token. I made a mistake for using access_token instead

这篇关于AWS Api Gateway Authorizer + Cognito User Pool Not Working {“message": “Unauthorized"}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆