[英]chalice-cognito-auth obtained id_token but still getting "User is not authorized"
Try to use https://pypi.org/project/chalice-cognito-auth/尝试使用https://pypi.org/project/chalice-cognito-auth/
I was able to get a json response like:我能够得到 json 响应,例如:
{"id_token":"eyJra...sda",
"refresh_token":"eyJjd...",
"access_token":"eyJraWQiO...",
"token_type":"Bearer"}
But when I try to use it like但是当我尝试使用它时
curl -H "Authorization: id_token value ..." http://127.0.0.1:8000/whoami
It replied它回复了
{
"Message": "User is not authorized to access this resource"
}
Try this, curl -H "Authorization: Bearer id_token" http://127.0.0.1:8000/whoami
试试这个,
curl -H "Authorization: Bearer id_token" http://127.0.0.1:8000/whoami
ie, you missed the Bearer
keyword.即,您错过了
Bearer
关键字。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.