Multiple authorization support not being recognized from CLI
See original GitHub issueDescribe the bug
When trying to set up a graphql api that allows a model to be publicly accessible with an API key but also have @auth restrictions with cognito user pools, it only respects the first/default option selected. In the backend-config.json
this is the result of running the steps below:
...
"authConfig": {
"additionalAuthenticationProviders": [],
"defaultAuthentication": {
"authenticationType": "API_KEY",
"apiKeyConfig": {
"description": "public api",
"apiKeyExpirationDays": 7
}
}
}
...
Manually updating App Sync from the console to have the additional authorization providers only partially works, because you still wont be able to update your schema to have the public and owner rules in the @auth directive. The CLI will throw @auth directive with 'userPools' provider found, but the project has no Cognito User Pools authentication provider configured.
Amplify CLI Version 4.13.4
To Reproduce from the cli: ? Please select from one of the below mentioned services: GraphQL ? Choose the default authorization type for the API API key ? Enter a description for the API key: public api ? After how many days from now the API key should expire (1-365): 7 ? Do you want to configure advanced settings for the GraphQL API Yes, I want to make some additional changes. ? Configure additional auth types? Yes ? Choose the additional authorization types you want to configure for the API (chose cognito user pool) ? Configure conflict detection? No
Expected behavior I would expect the CLI to be able to add the secondary auth provider to the API and allow for multiple auth rules.
Desktop (please complete the following information):
- OS: Mac
- Node Version: v12.6
From blog posts and docs, i have found a couple resources explaining this functionality:
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
@kjetilge @RussMax783 If you install the latest version of the CLI - you can use
amplify push --force
to push changes for just your auth settings to the cloud even if your status says - “No change”.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 for those types of questions.