django-rest-social-auth登录并给我错误400错误请求

时间:2018-02-04 14:27:52

标签: django django-rest-framework google-oauth2 django-socialauth django-rest-auth

伙计们正在github上工作的django-rest-social-auth https://github.com/st4lk/django-rest-social-auth 并尝试将谷歌登录添加到我的django休息框架应用程序 首先,我从此网址获取code

https://accounts.google.com/o/oauth2/auth?response_type=code&client_id={{CLIENT_ID}}&redirect_uri={{REDIRECT_URL}}&scope=email

然后 我发送所需的参数,例如clientIdredirect_uriprovidercode

http://localhost:8000/api/login/social/jwt/google/

使用邮递员和浏览器表格,但是:

我得到HTTP 400 Bad Request错误,我也在服务器控制台中看到了这个错误:

    raise AuthForbidden(args[0])
social_core.exceptions.AuthForbidden: Your credentials aren't allowed

这是我发布的数据:

  {   
    "clientId": "61235520-pn78ds5sds5d21d21jmn1e9.apps.googleusercontent.com",
    "redirect_uri": "http://localhost:4200/",
    "provider": "google-oauth2",
    "code": "4%2Fto7CCGznNFgE-rsssPlEQzV3lY9yjUWW_85YmPWF4OU"
  }

为什么???

0 个答案:

没有答案