无法从Node.js中的用户池使用令牌返回访问身份池

问题描述

用户成功登录后,我正在尝试通过用户池中的令牌返回访问身份池,但是现在我得到:These credentials are not valid for accessing this resource。我已经在身份池的身份验证提供程序中设置了UserpoolId和ClientId。 这是我的代码

    AWS.config.region = 'us-xxx-xx';
    AWS.config.credentials = new AWS.CognitoIdentityCredentials({
        IdentityPoolId: 'us-xxxxxx',Logins: {
            'cognito-idp.us-xxx-xx.amazonaws.com/us-xxx-xxx': 'token-return-from-user-pool'
        },});
    const cognito = new CognitoIdentity;
    const openIdToken = await cognito.getopenIdTokenForDeveloperIdentity({
        IdentityPoolId: 'us-xxxxxx',TokenDuration: 3600,}).promise();

我收到此错误These credentials are not valid for accessing this resource

我哪里错了?请帮助我

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)