简体   繁体   中英

Amazon cognito and Identity pool issue

Ok so I am using the Sample app that mobile hub provides for you and using it as a test app. I have been working on this for days and hours and cannot figure this issue out.

Currently My console is out putting

Unauthenticated access is not supported for this identity pool.

Once my console output was giving me this message I assumed I was NOT initializing my cognito id. So I put the following code into the appDelegate.(May be the wrong place to put it I wasnt sure)

在此处输入图片说明

After adding that code My console still gave me the same console output.

Unauthenticated access is not supported for this identity pool.

在此处输入图片说明

So now the only thing I can assume is that my roles are messed up or my IAM is not set up properly can someone please point me in the right direction.

From the screenshots you included, it looks like you've modified some things outside of Mobile Hub that may be impacting your app project. It looks like you have set the same role for auth and unauth access in Amazon Cognito, something that would never happen from within AWS Mobile Hub.

In the User Sign-in feature in AWS Mobile Hub, the first choice you make is whether you want Sign-in to be Optional or Mandatory (or disabled). You will have unauthenticated access only if you configure sign-in to be Optional or disabled. If you choose Mandatory, then you will only have an authenticated role, and I don't think you can re-use the same role for authenticated and unauthenticated access in Amazon Cognito, the way your screenshot indicates.

I'd recommend going into the AWS Mobile Hub console for your project, on the User Sign-in feature set sign-in to disabled and save, then set it to Optional and configure your provider keys and save. That should overwrite your settings in Amazon Cognito, and then download and run the sample mobile app project from the Integrate page, and make sure sign-in works properly.

For more information on the User Sign-in feature in AWS Mobile Hub, please reference the developer guide, here...
http://docs.aws.amazon.com/mobile-hub/latest/developerguide/user-sign-in.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM