-
Notifications
You must be signed in to change notification settings - Fork 819
Closed
Labels
platformIssues tied to the general CLI platformIssues tied to the general CLI platformquestionGeneral questionGeneral question
Description
Describe the bug
I'm using the following @auth
configuration for my GraphQL @model
:
@auth (
rules: [
{ allow: owner },
{ allow: public, provider: apiKey, operations: [read] }
]
)
I have setup Amazon Cognito User Pool as primary and apiKey as secondary authorization type:
amplify update api
? Please select from one of the below mentioned services GraphQL
? Choose the default authorization type for the API Amazon Cognito User Pool
Use a Cognito user pool configured as a part of this project.
? Do you want to configure advanced settings for the GraphQL API Yes, I want to make some additional changes.
? Choose the additional authorization types you want to configure for the API (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◯ API key
◯ IAM
◯ OpenID Connect
When I then run amplify push
I get the following error:
@auth directive with 'apiKey' provider found, but the project has no API Key authentication provider configured.
To Reproduce
Annotate your model with:
@auth (
rules: [
{ allow: owner },
{ allow: private, provider: apiKey, operations: [read] }
]
)
Configure both Cognito Pool and apiKey auth providers via Amplify CLI. run amplify push
Expected behavior
Schema should compile and function as expected. Where a Cognito user has full access and an apiKey user has access only to a query.
Version:
Amplify: 3.14.0
arnm, Afanasievov, abrahamAlonzo, elankeeran, nat-n and 5 more
Metadata
Metadata
Assignees
Labels
platformIssues tied to the general CLI platformIssues tied to the general CLI platformquestionGeneral questionGeneral question