Debugging django-allauth Social Network Login Failure

后端 未结 6 1619
温柔的废话
温柔的废话 2020-12-11 06:43

When using django-allauth to do an OAuth login via a social provider, sometimes it fails with the error page \"Social Network Login Failure\". There is no log output contai

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-11 07:25

    @Zags answers is great and pointed me in the right direction.

    Building on that answer, I suggest start by copying the default authentication_error.html to your tree, e.g.:

    $ find /wherever/your/python/is -name socialaccount
    $ cp .../that/dir/socialaccount/authentication_error.html \
         ./myapp/templates/allauth/socialaccount/
    

    Then add in to the copy of the template:

    Code: {{ auth_error.code }}, Error: {{ auth_error.exception }}

    (Technically you could just edit the installed python version...)

    Result for me, slightly formatted:

    Code: unknown, 
    Error: Error retrieving access token: 
    b'{"error":{
      "message":"This IP can\'t make requests for that application.",
      "type":"OAuthException",
      "code":5,
      "fbtrace_id":"..."
    }}'
    

提交回复
热议问题