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"
}