amazon-cognito - 未经身份验证的用户的 AWS Amplify API 身份验证错误
问题描述
我使用 Amplify 为 iOS 应用程序创建了一个书籍 API。我希望 book 表对经过身份验证和未经身份验证的用户都具有读取权限。这是架构:
type Book
@model
@searchable
@auth(
rules: [
{allow: private, provider: userPools, operations: [read]},
{allow: groups, groups: ["Admin"]}
]
)
{
id: ID!
category: BookCategoryType!
description: String
groupsCanAccess: [String]!
images: [Image!]
@auth(rules: [
{allow: groups, groupsField: "groupsCanAccess", operations: [read]},
{allow: groups, groups: ["Admin"]}
])
title: String!
}
但是,从 调用fetch
时AWSAppSyncClient
,出现以下错误:
authenticationError(AWSMobileClient.AWSMobileClientError.notSignedIn(message: "User is not signed in, please sign in to use this API."))
Cognito 身份池已Enable access to unauthenticated identities
检查并且存在未经身份验证的 IAM 角色。
可能是什么问题呢?
解决方案
推荐阅读
- python - 如何检查目录大小/如何确保重新定位文件完成
- powerbi - 如何在 Power BI 中使用度量值对表进行转置?
- python - 有没有办法在删除后恢复内置函数?
- c++ - 如何在 C++ 中获得“静态纯虚拟”功能?
- javascript - 上传相同文件名时忽略文件输入更改事件
- spring-integration-dsl - RouteByException 导致错误处理程序被调用两次它处理程序抛出运行时异常
- python - Linux:本地存储主要被 pip 的过多缓存消耗
- greenplum - GPLOAD 在并行线程中运行时有时会合并文件
- angular8 - 将值从 @Input 传递到提供的注入令牌
- c# - 如何使用 Linq 对列表进行分组和求和