简体   繁体   中英

Unauthenticated access is not supported for this identity pool, while using DynamoDB

I am exploring AWS for iOS,

I am trying to use following things,
1.DynamoDB
2.Cognito
3.Facebook LogIn

I was getting AWS DynamoDB scan working when there wasn't any LogIn integrated. After integration LogIn with Facebook, I am configuring facebook to cognito like this:

 if let fbToken = FBSDKAccessToken.currentAccessToken().tokenString{
        let credentialsProvider = AWSCognitoCredentialsProvider(
        regionType: CognitoRegionType,
        identityPoolId: CognitoIdentityPoolId)
        credentialsProvider.logins = [AWSCognitoLoginProviderKey.Facebook.rawValue: fbToken]
 }

But after configuring this I don't have access of DynamoDB now. It says: Unauthenticated access is not supported for this identity pool

Note: LogIn is necessary in my case.

The exception you are seeing means that identity pool is not setup to allow unauthenticated identities. But since you are using Facebook Token and getting this error, it seems that token may not have been set correctly on credentials provider.

This blog might be useful https://mobile.awsblog.com/post/Tx92ASFNST8JPV/Using-Amazon-Cognito-with-Swift-sample-app-developer-guide-and-more

Sounds like you need to take a look at your Cognito user or role policies. Take a look and see if the users created through the fb call and the unauthenticated roles are allowed access to dynamoDB.

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