1

我正在尝试从一个简单的 AWS Cognito 托管 UI 中获取 Google 用户数据。“使用 Google 登录”时显示我的姓名,但在登录屏幕后我无法访问此数据。在AWS Amplify Docs的启用联合身份部分,它建议我使用withAuthenticator. 我能够看到基于联合身份的 google 用户登录,但无法在我的用户池中看到 google 用户。所以我的问题是,我的用户池中的配置设置是否不正确,或者我没有正确拉动谷歌用户?

在此处输入图像描述

import Amplify from 'aws-amplify';
import { Auth, Authenticator } from 'aws-amplify-react';

const federated = {
  google_client_id: 'XXXXX.apps.googleusercontent.com',
};

Amplify.configure({
  Auth: {
   identityPoolId: 'us-east-1:XXX',
   region: 'us-east-1', 
   userPoolId: 'us-east-1_XXX'
  },
});

render(
  <div>
    <Authenticator federated={federated}>
      <span>
        Hello
      </span>
   </Authenticator>
  </div>,

  document.getElementById('app'),
);
4

0 回答 0