简体   繁体   English

AWS amplify add auth:如何在执行 amplify cli 后添加重定向登录 URI

[英]AWS amplify add auth: how to add a redirect signin URI after executing the amplify cli

Context: I was following a AWS tutorial to create iOS application using Amplify.背景:我正在按照 AWS 教程使用 Amplify 创建 iOS 应用程序。 One of the steps was to use 'amplify add auth' and specify the 'redirect signing URI'.其中一个步骤是使用“放大添加身份验证”并指定“重定向签名 URI”。 For some reason the CLI didn't prompt me for the URL.由于某种原因,CLI 没有提示我输入 URL。 'amplify update auth' does not provide an option to specify the redirect URL. “放大更新身份验证”不提供指定重定向 URL 的选项。

Question: How can I add redirect URL to the project, after executing the 'amplify add auth' command?问题:如何在执行“amplify add auth”命令后将redirect URL 添加到项目中?

I don't know what problem you are having, but you can use我不知道你遇到什么问题,但你可以使用

amplify update auth

If you try:如果你试试:

amplify add auth

It will give you an error:它会给你一个错误:

Auth has already been added to this project. Auth 已添加到此项目中。 To update run amplify update auth.要更新运行放大更新身份验证。

Use amplify update auth, you will be asked for the URI.使用放大更新身份验证,您将被要求提供 URI。

Please note that certain attributes may not be overwritten if you choose to use defaults settings.

You have configured resources that might depend on this Cognito resource.  Updating this Cognito resource could have unintended side effects.

Using service: Cognito, provided by: awscloudformation
 What do you want to do? (Use arrow keys)
 What do you want to do? Apply default configuration with Social Provider (Federation)
 What domain name prefix do you want to use? myprojd2553e50-d2553e50
 Enter your redirect signin URI: myapp://callback/
? Do you want to add another redirect signin URI No
 Enter your redirect signout URI: myapp://signout/
? Do you want to add another redirect signout URI No
 Select the identity providers you want to configure for your user pool: (Press <space> to select, <a> to toggle all, <i> to invert selection)
>( ) Facebook
 ( ) Google
 ( ) Login With Amazon

If you need to start over, try:如果您需要重新开始,请尝试:

amplify init
amplify pull auth
amplify remove auth
amplify add auth

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM