AWS Amplify를 AWS Cognito 설정에 인증 할 수 없습니다. 다음 코드를 사용하여 설정합니다. 내가 오류 없음 userPool 오류로 기록 얻을 그러나 AWS로 로그인하기 React Native에서 증폭
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
로그인합니다.
예제는 다음과 같습니다. https://github.com/aws/aws-amplify/blob/master/media/authentication_guide.md에는 소문자로 시작하는 구성 속성이 일부 있습니다. 그러나 그 다음에는 레드 스크린이 나타납니다.
그래, 소문자 속성을 사용하여 처음 시도했지만 오류가있는 React-Native Red Screen이 표시됩니다. * UserPoolId와 ClientId가 모두 필요합니다. * Amplify.configure ({ 인증 : { \t \t identityPoolId를 '우리는 서쪽-2 : XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', // 필수 - 아마존 Cognito 신원 풀 ID 지역 : '우리 서쪽 -2 ', // 필수 - Amazon Cognito Region userPoolId :'us-west-2_XXXXXXXX ', // 선택 사항 - Amazon Cognito 사용자 풀 ID } }); – user1176516
오른쪽. userPoolId 및 userPoolWebClientId는 signIn/signUp/signOut 등에서 필요합니다. 가이드에서 이에 대해 더 분명히해야합니다. –