AWS通过Facebook登录放大NotAuthorizedException

时间:2019-07-26 21:00:18

标签: facebook amazon-web-services react-native aws-amplify

我正在尝试使用AWS Amplify Facebook身份验证在我的应用程序上创建Facebook登录。这是我的代码:

async fbSignIn(){
    const { type, token, expires } = await Facebook.logInWithReadPermissionsAsync('DEV_ID', {
        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);
        });
    }
}

但是,我遇到此错误:

ERROR: [NotAuthorizedException: Invalid login token. Not a valid OpenId Connect identity token.]

有什么解决方法吗?

0 个答案:

没有答案