【问题标题】:Cognito AssociateSoftwareToken: token does not have required scopesCognito AssociateSoftwareToken:令牌没有必需的范围
【发布时间】:2022-04-04 00:45:08
【问题描述】:

我正在根据official documentation 在 Cognito 中设置基于 TOTP 的 MFA。用户池配置完毕,接下来就是关联token了。使用 boto3:

client = boto3.client('cognito-idp')
client.associate_software_token(access_token)

返回错误:

NotAuthorizedException when calling the AssociateSoftwareToken operation: 
Access Token does not have required scopes

令牌的范围为email profile openid。我错过了什么,它期望的其他范围是什么?

【问题讨论】:

    标签: amazon-cognito multi-factor-authentication


    【解决方案1】:

    您缺少几乎所有与用户帐户相关的操作都需要的 aws.cognito.signin.user.admin 范围。

    查看这个问题了解更多详情:What does the `aws.cognito.signin.user.admin` scope mean in Amazon Cognito?

    【讨论】:

      【解决方案2】:

      根据上面@Aleksandar Wons 的(正确)答案,这里的屏幕截图显示了如何/在哪里设置您的 Cognito 应用程序客户端中的 aws.cognito.signin.user.admin 范围。

      【讨论】:

        猜你喜欢
        • 2014-03-05
        • 1970-01-01
        • 2016-09-18
        • 2020-04-25
        • 2023-03-23
        • 2022-08-17
        • 1970-01-01
        • 2021-12-17
        • 2015-06-19
        相关资源
        最近更新 更多