How to link my mobile hub with my existing cognito user pool?

孤人 提交于 2019-12-01 21:17:29

AWS Mobile Hub does not currently provide a means to import your existing Cognito User Pool into the project, however, you can use whatever Cognito User Pool you like with the Mobile Hub-generated Cognito Identity Pool with a few easy steps. First, add a User Pool to the Mobile Hub project, so the project has Auth enabled. Then click on the Resources link and find your Cognito Identity Pool, and click the deep-link to the Cognito console. Now, click to Edit your Identity Pool. Under "Authentication Providers" you'll find settings for the Cognito User Pool; set those values based on your Cognito User Pool. Then, go back into the Mobile Hub console and when you download the configuration file for whatever app platform you want, just edit the resulting file to put in the correct Cognito User Pool settings.

For example, if you're using Android, in the Mobile Hub console, you'll click "Integrate" on the Android card, and "Download Config File." Then, you'd edit these lines in the "awsconfiguration.json" file.

"CognitoUserPool": {
  "Default": {
    "PoolId": "us-east-1_9rEQUqXYZ",
    "AppClientId": "gsdnilro5k0hillo8t6ojlxyz",
    "AppClientSecret": "pkqbqn8ulo08lghald06sjeib4mvbvpd6b0qork2h30n5klixyz",
    "Region": "us-east-1"
  }
},

...to use the appropriate values for your Cognito User Pool, and you should be good to go.

Note that these instructions should let you re-use the Cognito User Pool, but because the Cognito Identity Pool has changed, your user identity ID values will change.

We have had several customers request being able to re-use their Cognito User Pool and Cognito Identity Pool, so we are working on prioritizing those requests, but I can't say exactly when that functionality would be available.

Sincerely,
Andrew C
AWS Mobile Developer Experience

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!