我在应用程序上调用此功能,以允许通过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作为用户池的身份提供者。 有什么想法我可以解决这个问题吗?