【发布时间】: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