3

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.

Mohammad Zaid Pathan
  • 16,304
  • 7
  • 99
  • 130

2 Answers2

2

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

patanjal
  • 645
  • 4
  • 4
1

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.

kakkman
  • 93
  • 2
  • 11