Cognito AssociateSoftwareToken:令牌没有必需的范围

Cognito AssociateSoftwareToken: token does not have required scopes

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

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

其中returns错误:

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

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

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

有关详细信息,请参阅此问题:

跟进上面@Aleksandar Wons 的(正确)回答,下面是显示 how/where 在 Cognito 应用程序客户端中设置 aws.cognito.signin.user.admin 范围的屏幕截图。