简体   繁体   English

chalice-cognito-auth 获得了 id_token 但仍然得到“用户未授权”

[英]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.

相关问题 使用 Cognito 用户池的 AWS Amplify Auth 未在 JWT id_token 中返回 nonce 或 at_hash 声明 - AWS Amplify Auth with Cognito User Pool not returning nonce or at_hash claim in JWT id_token 自定义属性未传递到 AWS Cognito 创建的 ID_TOKEN - Custom attribute not passed into ID_TOKEN created by AWS Cognito AWS Cognito 托管 UI 在 URL 中返回 id_token - AWS Cognito hosted UI returning id_token in URL 具有 Azure AD SAML 集成的 Cognito 授权返回 id_token 和 access_token 但没有刷新令牌 - Cognito Authorization with Azure AD SAML integration returns id_token and access_token but no refresh token Auth0 Android-如何续订id_token? - Auth0 Android - How to renew id_token? 使用 scope openId 使用 id_token 或 access_token 登录 cognito 不起作用 - Login cognito using with scope openId using id_token or access_token don't working 尝试使用 Cognito 向 Battle.net OIDC 进行身份验证时出现错误的 id_token 颁发者 - Bad id_token issuer when trying to authenticate with Battle.net OIDC with Cognito swift:将Facebook当前令牌发送到AWS Cognito之后,接收AWS id_token吗? - swift:receive AWS id_token after sending facebook current token to AWS Cognito? Cognito '/oauth2/token' 端点未返回 'id_token' 用于 PKCE 的授权代码授予 - Cognito '/oauth2/token' end point not returning 'id_token' for Authorization Code Grant with PKCE AWS S3:使用Cognito的id_token对ApiGateway进行私有访问:可以吗? - AWS S3: private access using id_token from Cognito like to the ApiGateway: is it possible?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM