question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple authorization support not being recognized from CLI

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kaustavghosh06commented, Mar 19, 2020

@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”.

0reactions
github-actions[bot]commented, May 26, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting AWS CLI errors - AWS Command Line Interface
Confirm that your AWS CLI is configured. Various errors can occur if your config and credentials files or your IAM user or roles...
Read more >
Sign in with Azure CLI — Login and Authentication
Learn the different authentication types for your Azure CLI login — sign in with Azure CLI automatically, locally, or interactively using ...
Read more >
Vault Commands (CLI) - HashiCorp Developer
The following write command creates a new user ( bob ) in the userpass auth method. It passes the -address flag to specify...
Read more >
aws-adfs command line tool - GitHub
Authenticates an user with active directory credentials Options: --profile TEXT AWS cli profile that will be authenticated.
Read more >
Authorize the gcloud CLI | Google Cloud CLI Documentation
A service account is recommended to run gcloud CLI scripts on multiple machines ... To authorize access without performing other setup steps, use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found