【问题标题】:Cognito callback token to API GW Authorizer到 API GW Authorizer 的 Cognito 回调令牌
【发布时间】:2021-10-18 22:44:30
【问题描述】:

有没有办法使用通过 Cognito 回调 URL 传递给 APIGW 的令牌来授权 APIGW 调用?目前用户去https://poolid.auth.region.amazoncognito.com/login?client_id=clientid&response_type=token&scope=email+openid+phone+profile&redirect_uri=$ApiGWInvokeUrl 然后重定向到https://abc123.execute-api.region.amazonaws.com/dev#id_token=......&access_token=......&expires_in=3600&token_type=Bearer

令牌信息在测试 Authorizer 时有效,但调用返回“缺少身份验证令牌”。如何更改 API GW 以从重定向中获取令牌信息并将其传递给 Cognito Authorizer?

【问题讨论】:

    标签: amazon-web-services postman aws-api-gateway amazon-cognito


    【解决方案1】:

    没有。您的浏览器不会将 URL 片段发送到后端。 URL 中# 之后的任何内容(包括令牌)都不会发送到 API Gateway。

    【讨论】:

    • URL查询字符串参数不允许处理吗?
    • 它们的格式类似于查询字符串参数,但实际上并非如此。检查 url,# 之后的所有内容都是 url 片段,不会发送到后端。
    猜你喜欢
    • 2019-08-20
    • 2022-11-15
    • 2022-11-05
    • 2021-02-02
    • 1970-01-01
    • 2020-05-13
    • 1970-01-01
    • 2020-06-18
    • 2020-07-11
    相关资源
    最近更新 更多