amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

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

Open oahmaro opened this issue 7 years ago • 11 comments

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.

oahmaro avatar Nov 28 '19 17:11 oahmaro

@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 :)

Jkap7788 avatar Dec 01 '19 10:12 Jkap7788

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

ammarkarachi avatar Dec 04 '19 00:12 ammarkarachi

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

kaustavghosh06 avatar Dec 10 '19 00:12 kaustavghosh06

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

kaustavghosh06 avatar Dec 10 '19 00:12 kaustavghosh06

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

yuyokk avatar Jan 05 '20 13:01 yuyokk

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

Thanks, Dan

luizdanieldesouza avatar Jan 11 '20 02:01 luizdanieldesouza

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 avatar Feb 22 '20 14:02 BhanukaUOM

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

jafbueno-zz avatar Mar 06 '20 11:03 jafbueno-zz

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

aleksei-tro avatar Aug 28 '20 04:08 aleksei-tro

Referring to Issue 206

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

blkc avatar Oct 10 '20 22:10 blkc

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[bot] avatar May 25 '21 19:05 github-actions[bot]