Not Authorized to access createProject on type Project with Appsync and Cognito
See original GitHub issueDescribe the bug I’m receiving this error message when trying to execute a mutation, I think isn’t a bug, maybe I just forget to do some configuration, because I’m receiving this error executing the mutation on the Appsync dashboard, and also on the application.
To Reproduce Steps to reproduce the behavior:
- Create a project with
amplify init
- Create an auth
amplify add auth
Using service: Cognito, provided by: awscloudformation Do you want to use the default authentication and security configuration? Default configuration How do you want users to be able to sign in? Email Do you want to configure advanced settings? No, I am done.
- Create an API
amplify add api
Please select from one of the below mentioned services: GraphQL Provide API name: (test) Choose the default authorization type for the API Amazon Cognito User Pool Do you want to configure advanced settings for the GraphQL API No, I am done. Do you have an annotated GraphQL schema? No Choose a schema template: Single object with fields (e.g., “Todo” with ID, name, description)
- My Appsync schema
type Project
@model
@auth(
rules: [
{ allow: owner, ownerField: "owner" }
{ allow: owner, ownerField: "members", operations: [read] }
]
) {
id: ID!
name: String!
owner: String!
members: [String]
}
Screenshots If applicable, add screenshots to help explain your problem.
I’m receiving this same error on the application, my user is confirmed by email verification code.
Environment
System:
OS: Windows 10 10.0.18363
CPU: (8) x64 Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
Memory: 4.63 GB / 15.82 GB
Binaries:
Node: 12.18.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 86.0.4240.193
Edge: Spartan (44.18362.449.0)
Internet Explorer: 11.0.18362.1
npmPackages:
@types/node: ^12.12.38 => 12.19.4
eslint-plugin-import: ^2.18.2 => 2.22.1
eslint-plugin-prettier: ^3.1.1 => 3.1.4
eslint-plugin-react: ^7.17.0 => 7.21.5
prettier: ^2.0.4 => 2.1.2
react-scripts: ^3.4.1 => 3.4.4
npmGlobalPackages:
@aws-amplify/cli: 4.32.1
serverless: 2.6.0
You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = ‘DEBUG’; in your app.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Ah ok great! Yes, that is definitely a valid use of
identityClaim
here given your Auth configuration. I’ll close this for now, but feel free to open it back up if you’re still having problems 🙂This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels or Discussions for those types of questions.