[英]Unauthenticated access is not supported for this identity pool, while using DynamoDB
I am exploring AWS for iOS, 我正在探索适用于iOS的AWS,
I am trying to use following things, 我正在尝试使用以下内容,
1.DynamoDB 1.DynamoDB
2.Cognito 2.Cognito
3.Facebook LogIn 3.Facebook登录
I was getting AWS DynamoDB scan working when there wasn't any LogIn integrated. 当没有集成任何LogIn时,我正在使AWS DynamoDB扫描工作。 After integration LogIn with Facebook, I am configuring facebook to cognito like this:
在使用Facebook集成LogIn之后,我正在将facebook配置为cognito,如下所示:
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. 但配置完成后,我现在无法访问DynamoDB。 It says:
Unauthenticated access is not supported for this identity pool
它说:
Unauthenticated access is not supported for this identity pool
Note: LogIn is necessary in my case. 注意:在我的情况下,LogIn是必需的。
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.
但由于您使用Facebook令牌并收到此错误,似乎令牌提供程序上可能未正确设置令牌。
This blog might be useful https://mobile.awsblog.com/post/Tx92ASFNST8JPV/Using-Amazon-Cognito-with-Swift-sample-app-developer-guide-and-more 此博客可能很有用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. 听起来您需要查看Cognito用户或角色策略。 Take a look and see if the users created through the fb call and the unauthenticated roles are allowed access to dynamoDB.
看看是否允许通过fb调用创建的用户和未经身份验证的角色访问dynamoDB。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.