首页 > 解决方案 > AWS Amplify:令牌不是来自此身份池的受支持提供商

问题描述

我在我的应用程序上调用此函数以允许通过 Facebook 登录。

async fbSignIn(){
    const { type, token, expires } = await Facebook.logInWithReadPermissionsAsync('454050215391261', {
        permissions: ['public_profile'],
    });
    if (type === 'success') {
        console.log(token);
        Auth.federatedSignIn('facebook', { token, expires_at: expires}, { name: 'USER_NAME' })
        .then(credentials => {
            console.log('get aws credentials', credentials);
            console.log("userProfile: ",JSON.stringify(userProfile));
            this.setState({ userProfile: userProfile});
            this.props.navigation.replace('Dashboard');
        }).catch(e => {
            console.log("ERROR:",e);
        });
    }
}

它正确打开了 Facebook UI,但输入我的凭据后,我收到此错误:

NotAuthorizedException: Token is not from a supported provider of this identity pool.

我已启用 Facebook 作为我的用户池的身份提供者。有什么想法可以解决这个问题吗?

标签: amazon-web-servicesreact-nativeauthenticationaws-amplify

解决方案


推荐阅读