【问题标题】:Using the group role from the current user session AWS Cognito使用当前用户会话 AWS Cognito 中的组角色
【发布时间】:2021-08-19 13:41:40
【问题描述】:

是否可以使用当前用户会话中的组 IAM 角色而不是用户的身份验证角色?

我正在获取我当前的用户会话并使用此会话实例化一个新的CognitoIdentityServiceProvider 服务,如下所示:

const currentCredentials = await $Amplify.Auth.currentCredentials();
`const cognitoIdentityServiceProvider = new AWS.CognitoIdentityServiceProvider(currentCredentials);`

这使用 auth 角色而不是用户所在的组,我没有看到将 roleARN 作为参数传递给服务的选项

【问题讨论】:

    标签: amazon-web-services aws-sdk amazon-cognito


    【解决方案1】:

    您可以更改身份池而不是用户池中的设置。编辑身份池并选择身份验证提供程序。这里可以让 cognito 从 token 中选择角色。

    【讨论】:

    • 谢谢你!!!!!!!!!我一直在寻找这个答案几个小时。
    猜你喜欢
    • 2018-07-17
    • 2017-09-02
    • 2019-06-24
    • 2020-09-19
    • 2019-08-15
    • 2019-02-08
    • 2019-10-06
    • 1970-01-01
    • 2020-01-06
    相关资源
    最近更新 更多