Amplify push fails after adding auth with 3rd party providers (Facebook and Google)
Describe the bug
When using default auth configuration, amplify auth add and then amplify push succeeds. When using 3rd party providers (Facebook and Google), amplify push fails.
To Reproduce
npm i -g @aws-amplify/cliamplify configureamplify initamplify add auth
See below logs from amplify auth add:
Do you want to use the default authentication and security configuration? No, I will set up my own configuration.
? Select the authentication/authorization services that you want to use: User Sign-Up, Sign-In, connected with AWS IAM controls (Enables per-user Storage features for images or other content, Analytics, and more)
? Allow unauthenticated logins? (Provides scoped down permissions that you can control via AWS IAM) No
? Do you want to enable 3rd party authentication providers in your identity pool? Yes
? Select the 3rd party authentication providers that you want to enable: Facebook, Google
You've opted to allow users to authenticate via Facebook. If you haven't already, you'll need to go to https://developers.facebook.com and create an App ID.
Enter your Facebook App ID: **************
You've opted to allow users to authenticate via Google. If you haven't already, you'll need to go to https://developers.google.com/identity and create an App ID.
Enter your Google Web Client ID: *****************
? Multifactor authentication (MFA) user login options: OFF
? Email based user registration/forgot password: Enabled (Requires per-user email entry at registration)
? Please specify an email verification subject: Your verification code
? Please specify an email verification message: Your verification code is {####}
? Do you want to override the default password policy for this User Pool? No
? Specify the app's refresh token expiration period (in days): 30
? Do you want to specify the user attributes this app can read and write? No
amplify push
Current Environment: dev
| Category | Resource name | Operation | Provider plugin |
| -------- | ---------------- | --------- | ----------------- |
| Auth | cognito4cc0cb2a | Update | awscloudformation |
| Api | notesforthoughts | No Change | awscloudformation |
? Are you sure you want to continue? Yes
⠋ Updating resources in the cloud. This may take a few minutes...
UPDATE_FAILED authcognito4cc0cb2a AWS::CloudFormation::Stack Fri Feb 15 2019 10:42:04 GMT-0500 (Eastern Standard Time) Template format error: YAML not well-formed. (line 364, column 62)
UPDATE_IN_PROGRESS authcognito4cc0cb2a AWS::CloudFormation::Stack Fri Feb 15 2019 10:42:03 GMT-0500 (Eastern Standard Time)
UPDATE_IN_PROGRESS notesforthoughts-20190214120616 AWS::CloudFormation::Stack Fri Feb 15 2019 10:41:58 GMT-0500 (Eastern Standard Time) User Initiated
⠇ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_IN_PROGRESS notesforthoughts-20190214120616 AWS::CloudFormation::Stack Fri Feb 15 2019 10:42:06 GMT-0500 (Eastern Standard Time) The following resource(s) failed to update: [authcognito4cc0cb2a].
⠸ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS notesforthoughts-20190214120616 AWS::CloudFormation::Stack Fri Feb 15 2019 10:42:18 GMT-0500 (Eastern Standard Time)
UPDATE_COMPLETE authcognito4cc0cb2a AWS::CloudFormation::Stack Fri Feb 15 2019 10:42:16 GMT-0500 (Eastern Standard Time)
UPDATE_IN_PROGRESS authcognito4cc0cb2a AWS::CloudFormation::Stack Fri Feb 15 2019 10:42:19 GMT-0500 (Eastern Standard Time)
⠴ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_COMPLETE notesforthoughts-20190214120616 AWS::CloudFormation::Stack Fri Feb 15 2019 10:42:20 GMT-0500 (Eastern Standard Time)
UPDATE_COMPLETE authcognito4cc0cb2a AWS::CloudFormation::Stack Fri Feb 15 2019 10:42:20 GMT-0500 (Eastern Standard Time)
⠴ Updating resources in the cloud. This may take a few minutes...Error updating cloudformation stack
✖ An error occurred when pushing the resources to the cloud
Resource is not in the state stackUpdateComplete
Expected behavior Amplify push succeeds without any errors
Screenshots Here's line 364 in cognito4cc0cb2a-cloudformation-template.yml file mentioned in the error message:
Resource: !If [ShouldNotCreateEnvResources, arn:aws:iam:::role/cognito4cc0cb2a_openid_lambda_role, !Join ['',[arn:aws:iam:::role/cognito4cc0cb2a_openid_lambda_role, '-', !Ref env]]]
Additional context http://www.yamllint.com gives me this error when trying to validate the yaml file: "found unexpected ':' while scanning a plain scalar at line 364 column 59"
@davidkiss What version of the CLI are you using?
1.1.0
On Fri, Feb 15, 2019, 16:51 UnleashedMind <[email protected] wrote:
@davidkiss https://github.com/davidkiss What version of the CLI are you using?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws-amplify/amplify-cli/issues/882#issuecomment-464215137, or mute the thread https://github.com/notifications/unsubscribe-auth/ABnjnFWwbgZVkRGOGVedSBiLTFCHlsVLks5vNyv7gaJpZM4a98O0 .
1.1.3 - same issue
1.1.5 - same issue. I've reset my project and reproduced the issue many times. Once I manually remove all the lines contains "openIdxxxxxxx" in all *.yml and *.json, the "amplify push" would work properly.
same here :(
The fix for this has been released in amplify cli v1.1.6. Please update the CLI and feel free to re-open the issue if it still persists.
This problem is still happening.
UPDATE_ROLLBACK_COMPLETE amplifyapplication1-20190323083301 AWS::CloudFormation::Stack Wed Mar 27 2019 09:30:54 GMT-0700 (Pacific Daylight Time) | Updating resources in the cloud. This may take a few minutes...Error updating cloudformation stack
- Updating resources in the cloud. This may take a few minutes...
Following resources failed
Resource Name: 2019/03/27/[$LATEST]cXXXXXXXXXXXa (Custom::LambdaCallout) Event Type: create Reason: Failed to create resource. See the details in CloudWatch Log Stream: 2019/03/27/[$LATEST]c36238c4XXXXXX3eeca
**× An error occurred when pushing the resources to the cloud
Resource is not in the state stackUpdateComplete**
C:\Users\unmes\StudioProjects\AmplifyApplication1>amplify --version 1.1.8
As you can see above, Amplify version is v1.1.8, and we've tried it multiple times across different systems and User pools.
still not working with 1.6.1 :(
wtf so it was the problem with cli itself?
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.