Wil*_*ang 7 authentication aws-amplify
G'day,
我有一个有效的 Amplify 项目。好吧,一切都很好,直到我运行amplify add auth并将更改推送到 master。我按照这里的说明https://dev.to/dabit3/the-complete-guide-to-user-authentication-with-the-amplify-framework-2inh
现在我收到以下错误,我的主人是红色的 :(
在放大文档中找不到任何有用的东西。我确实尝试headless_init_env_auth.sh从这个https://github.com/aws-amplify/amplify-cli/tree/master/packages/amplify-cli/sample-headless-scripts运行脚本,但它没有帮助。
这个错误似乎没有记录在任何地方。
2019-06-18T11:16:53.459Z [INFO]: Error: auth headless init is missing the following inputParams facebookAppIdUserPool, facebookAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool
at updateConfigOnEnvInit (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/provider-utils/awscloudformation/index.js:287:15)
at /root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/index.js:201:28
at /root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/promise-sequential/index.js:16:18
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:229:7)
2019-06-18T11:16:53.466Z [ERROR]: !!! Build failed
2019-06-18T11:16:53.466Z [ERROR]: !!! Non-Zero Exit Code detected```
Run Code Online (Sandbox Code Playgroud)
小智 10
对我来说,一个简单的修复方法是从 amplify 更新环境变量。
AMPLIFY_AMAZON_CLIENT_ID
AMPLIFY_AMAZON_CLIENT_SECRET
AMPLIFY_FACEBOOK_CLIENT_ID
AMPLIFY_FACEBOOK_CLIENT_SECRET
AMPLIFY_GOOGLE_CLIENT_ID
AMPLIFY_GOOGLE_CLIENT_SECRET
小智 3
在 AUTHCONFIG 中定义facebookAppIdUserPool、facebookAppSecretUserPool、googleAppIdUserPool、googleAppSecretUserPool。
#!/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
Run Code Online (Sandbox Code Playgroud)
或者可以使用 Amplify-CLI 命令
amplify init \
--amplify "{\"envName\":\"dev\"}" \
--categories "{\"auth\":{\"googleAppIdUserPool\":\"googleAppId\",\"googleAppSecretUserPool\":\"googleAppSecret\"}}" \
--yes
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1753 次 |
| 最近记录: |