问题描述
我使用 cognito & 的默认登录页面尝试在回调 URL 中传递查询参数.它似乎只适用于 1 个查询参数,但不适用于 2 个(没有尝试更多).我尝试对 URL 的查询参数进行编码(如此处的某些帖子中所述),但没有奏效.什么有效
I was using the default login page for cognito & trying to pass query parameters in the callback URL. It seems to work only with 1 query param but not 2 (did not try more than that). I tried encoding the query parameters of the URL (as was mentioned in some posts here) but did not work.What works
什么不起作用
- http://localhost:6768/portal.html?up=us-east-2_4AIAW7KJa&idp=us-east-2:2a45e21c-2541-4dcc-9edb-3015ee5fcb96
- http://localhost:6768/portal.html%3Fup%3Dus-east-2_4AIAW7KJa%26idp%3Dus-east-2%3A2a45e21c-2541-4dcc-9edb-3015ee5fcb96
任何线索如何使这项工作?现在,我已经作弊了&将其作为 val1=val2 &解析出来.
Any clue how to make this work? For now, I have cheated & feeding it as val1=val2 & parsing it out.
我使用云形成脚本创建了用户池和身份池.
I created the user pool, identity pool using cloud formation scripts.
推荐答案
来自 AWS 的响应 -
Response from AWS -
在控制台中,您应该提供未编码的 URL -https://www.google.com?val1=a&val2=b.访问托管 UI 时,您必须提供编码的重定向 URL -redirect_uri=https%3A%2F%2Fwww.google.com%3Fval1%3Da%26val2%3Db
希望这会有所帮助!
这篇关于AWS Cognito 回调 URL 中的查询字符串参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!