使用确认URL确认Amazon Cognito后如何重定向? [英] How to redirect after confirm amazon cognito using confirmation URL?

查看:224
本文介绍了使用确认URL确认Amazon Cognito后如何重定向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在用户以Amazon Cognito确认后,我想重定向到特定的网址。

I want to redirect to a specific url after the user confirmation in amazon cognito.

注册用户时,他将收到带有验证链接的确认邮件,如下所示
https://<> .auth.us-west-2.amazoncognito.com / confirmUser?client_id =<< >>& user_name =<< >>& confirmation_code =<< >>

When a user sign up he will get confirmation mail with a verification link as follows https://<>.auth.us-west-2.amazoncognito.com/confirmUser?client_id=<<>>&user_name=<<>>&confirmation_code=<<>>

如果用户单击

一旦用户确认完成,该页面应重定向到我的应用程序。

Once the user confirmation is completed the page should redirect to my application.

请给我一些解决此问题的想法。

Please give me some idea to solve this problem.

推荐答案

目前,无法使用电子邮件中的验证链接来完成此重定向。我曾尝试过将redirect_uri添加到验证URL上,但它们无法正常工作。

Currently, this redirection can't be done using verification link in email. I tried adding redirect_uri to the verification URL a while back but they do not work.

解决方法

成功后,返回302 https://myapp.com 从您的API网关

On success, return 302 https://myapp.com from your API Gateway

我知道这是解决这种简单要求的复杂方法。最好的方法是提出功能请求,并希望它们在Cognito URL中支持redirect_uri。

I know this is a convoluted workaround for such a simple requirement. The best way would be to raise a feature request and hope they support a redirect_uri in the Cognito URL.

EDIT

要节省Lambda成本,您还可以在API中使用HTTP终结点,并向您所在地区的认知服务端点。示例:

To save your lambda costs, you could also use an HTTP endpoint in your API and make a request to the cognito service endpoint for your region. Example:

POST  HTTP/1.1
Host: cognito-idp.us-east-1.amazonaws.com
x-amz-target: AWSCognitoIdentityProviderService.ConfirmSignUp
Content-Type: application/x-amz-json-1.1

{
  "ClientId":"xxxxxxxxxxxxx",
  "ConfirmationCode":"123456",
  "Username":"username"
}

这篇关于使用确认URL确认Amazon Cognito后如何重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆