【问题标题】:Using the aws cognito UserInfo endpoint使用 aws cognito UserInfo 端点
【发布时间】:2020-11-25 23:33:42
【问题描述】:

我正在尝试从我的 django rest 框架后端服务器调用此用户端点。 https://docs.aws.amazon.com/cognito/latest/developerguide/userinfo-endpoint.html

根据文档,我需要使用授权持有者令牌发出 GET 请求。 所以从我的后端我尝试过:

''' requests.get('https://cognito-idp.us-east-2.amazonaws.com/oauth2/userInfo',headers={'Authorization': 'Bearer'+str(request.auth)[2:-1 ]}) '''

最后的拼接只是从 django rest 框架的 request.auth 中去掉访问令牌周围的 b' 和 '。

我没有得到任何回复或 400 错误请求,但不是文档说我应该得到的那个。

我也以各种方式从邮递员那里尝试过这个。 Here's one of them

任何有关此请求的正确格式的帮助将不胜感激!谢谢。

【问题讨论】:

    标签: django amazon-web-services http authentication amazon-cognito


    【解决方案1】:

    您需要使用您的用户池域:

    https://{{user_pool_domain}}.auth.{{region}}.amazoncognito.com/oauth2/userinfo

    【讨论】:

      猜你喜欢
      • 2020-08-14
      • 2022-11-15
      • 2015-10-09
      • 2021-09-05
      • 2021-11-21
      • 2016-08-24
      • 2018-05-09
      • 1970-01-01
      • 2016-12-13
      相关资源
      最近更新 更多