Amplify-cli: Getting amplify deployment error: auth headless init is missing the following inputParams

Created on 28 Nov 2019  路  10Comments  路  Source: aws-amplify/amplify-cli

Note: If your question is regarding the AWS Amplify Console service, please log it in the
official AWS Amplify Console forum

Which Category is your question related to?
Amplify console, deploying multi env backend with auth.

Amplify CLI Version

You can use amplify -v to check the amplify CLI version on your system
4.2.0

What AWS Services are you utilizing?
Amplify, and Cognito

Provide additional details e.g. code snippets
Error: auth headless init is missing the following inputParams facebookAppIdUserPool, facebookAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool at updateConfigOnEnvInit (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/provider-utils/awscloudformation/index.js:315:15) at /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/index.js:241:28 at /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/promise-sequential/index.js:16:18 at process._tickCallback (internal/process/next_tick.js:68:7)

I have created 2 environments, prod, and dev. And both of them had google and facebook app id and app secret configured. and I checked the Cognito identity provider and I can see the correct App Id and App secret for both facebook and google there. I don't understand why I am having this error.

Can someone please explain in detail why I am getting this error and how should I fix it.

auth pending-response pending-triage

Most helpful comment

@BhanukaUOM please edit your comment to fix this part:
\"googleAppSecretUserPool \":\"googleAppSecret\"\

You added space just in front of "googleAppSecretUserPool", when executing this script an error appears indicating that this parameter does not exist. However, when removing the space, the parameter is accepted.

I had used this script in my tests, and I noticed this problem.

All 10 comments

@oahmaro Are you using the amplify console for deployment?

If so, I had the same error, see my comment here: https://github.com/aws-amplify/amplify-cli/issues/2833#issuecomment-558876796

The amplify console team are working on a fix and this is a temp workaround :)

@oahmaro Thanks for the issue we are looking into this.

@oahmaro Are you using the headless CLI scripts of the Ampliy console?

If you're using headless CLI scripts - please checkout this sample - https://github.com/aws-amplify/amplify-cli/blob/master/packages/amplify-cli/sample-headless-scripts/headless_init_env_auth.sh which incorporates adding og the inputParams as a part of the headless scripts

Facing the same issue on Amplify Console. Team, any plans on fixing the issue?

UPDATE: Ok I see issue is tracked here https://github.com/aws-amplify/amplify-console/issues/206

Facing the same issue on Amplify Console. Could you please help?

Thanks, Dan

Define facebookAppIdUserPool, facebookAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool in AUTHCONFIG.

Amplify-Cli command

amplify init \
--amplify "{\"envName\":\"dev\"}" \
--categories "{\"auth\":{\"googleAppIdUserPool\":\"googleAppId\",\"googleAppSecretUserPool\":\"googleAppSecret\"}}" \
--yes

or, If you use Bash Script use as follow

#!/bin/bash
set -e
IFS='|'

AUTHCONFIG="{\
\"facebookAppId\":\"fbid1\",\
\"googleClientId\":\"goog\",\
\"facebookAppIdUserPool\":\"facebookAppId\",\
\"facebookAppSecretUserPool\":\"facebookAppSecret\",\
\"googleAppIdUserPool\":\"facebookAppSecret\",\
\"googleAppSecretUserPool\":\"googleAppSecret\"\
}"
AWSCLOUDFORMATIONCONFIG="{\
\"configLevel\":\"project\",\
\"useProfile\":true,\
\"profileName\":\"default\"\
}"

AMPLIFY="{\
\"envName\":\"dev8\"\
}"
PROVIDERS="{\
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\
}"
CATEGORIES="{\
\"auth\":$AUTHCONFIG\
}"

amplify init \
--amplify $AMPLIFY \
--providers $PROVIDERS \
--categories $CATEGORIES \
--yes

@BhanukaUOM please edit your comment to fix this part:
\"googleAppSecretUserPool \":\"googleAppSecret\"\

You added space just in front of "googleAppSecretUserPool", when executing this script an error appears indicating that this parameter does not exist. However, when removing the space, the parameter is accepted.

I had used this script in my tests, and I noticed this problem.

I just had the same issue and I found a neat solution
modify your amplify.yml and add
- amplifyPush -e $AWS_BRANCH --simple
after npm ci

Referring to Issue 206

Docs are updated: https://docs.amplify.aws/lib/auth/social/q/platform/js#deploying-to-amplify-console

Was this page helpful?
0 / 5 - 0 ratings