我无法让 AWS Amplify 对我的 AWS Cognito 设置进行身份验证。我使用以下代码进行设置。
import Amplify from 'aws-amplify-react-native';
import { Auth } from 'aws-amplify-react-native';
Amplify.configure({
Auth: {
IdentityPoolId: 'us-west-2:XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
region: 'us-west-2',
UserPoolId: 'us-west-2_XXXXXXXX',
ClientId: 'XXXXXXXXXXXXXXX'
}
});
和此代码登录
Auth.signIn(this.state.username, this.state.password)
.then(user => console.log(user))
.catch(err => console.log(err)); //"No userPool" logged here
但是我收到错误No userPool记录为错误。
此处的示例:https ://github.com/aws/aws-amplify/blob/master/media/authentication_guide.md有一些以小写字母开头的配置属性,但是当我跟随时,我得到了红屏。