Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate API auth provider after api update #5240

Closed
ghost opened this issue Sep 3, 2020 · 2 comments · Fixed by #5272
Closed

Duplicate API auth provider after api update #5240

ghost opened this issue Sep 3, 2020 · 2 comments · Fixed by #5272
Assignees
Labels
api-graphql Issues related to GraphQL resources in the API category bug Something isn't working

Comments

@ghost
Copy link

ghost commented Sep 3, 2020

Describe the bug
Changing an additional auth type to be the default auth type, causes it to be set as both default and additional, if selecting 'No" to 'Configure additional auth types?' when running api update.

Amplify CLI Version
4.28.2

To Reproduce

amplify add api
? Please select from one of the below mentioned services: **GraphQL**
? Provide API name: **amplifybugtest**
? Choose the default authorization type for the API **API key**
? Enter a description for the API key: 
? 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 **IAM**
? Configure conflict detection? **No**
? Do you have an annotated GraphQL schema? **No**
? Choose a schema template: **Single object with fields (e.g., “Todo” with ID, name, description)**

amplify update api
? Please select from one of the below mentioned services: **GraphQL**
? Select from the options below **Update auth settings**
? Choose the default authorization type for the API **IAM**
? Configure additional auth types? **No**

The authConfig in amplify-meta.json now look like this:

"authConfig": {
  "defaultAuthentication": {
    "authenticationType": "AWS_IAM"
  },
  "additionalAuthenticationProviders": [
    {
      "authenticationType": "AWS_IAM"
    }
  ]
}

And 'amplify push' results in:
The following resource(s) failed to create: [GraphQLAPI]
Authentication type AWS_IAM for additional authentication provider 1 already specified on the API. It can only be specified once. (Service: AWSAppSync; Status Code: 400; Error Code: BadRequestException;

Expected behavior
AWS_IAM authentication type to be removed from additionalAuthenticationProviders

Desktop (please complete the following information):

  • OS: Mac
  • Node Version: v14.9.0
@akshbhu akshbhu added bug Something isn't working api-graphql Issues related to GraphQL resources in the API category labels Sep 3, 2020
@akshbhu
Copy link
Contributor

akshbhu commented Sep 3, 2020

Hi @11csive

Thanks for reporting this. I have reproduced it.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-graphql Issues related to GraphQL resources in the API category bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant