0

Try to use https://pypi.org/project/chalice-cognito-auth/

I was able to get a json response like:

{"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"
}
Mzq
  • 1,796
  • 4
  • 30
  • 65

1 Answers1

0

Try this, curl -H "Authorization: Bearer id_token" http://127.0.0.1:8000/whoami

i.e., you missed the Bearer keyword.

Incinerator
  • 2,589
  • 3
  • 23
  • 30