• Members 29 posts
    March 27, 2019, 11:47 p.m.

    I have created an app on twitter and double checked the callback url is correct but I keep getting the same problem.

    I get the error "Something's broken...
    The page you have requested is currently unavailable due to an error."

    I checked the log file and I have this:

    Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
    File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
    File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, callback_args, callback_kwargs)
    File "/usr/local/lib/python3.6/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args,
    kwargs)
    File "/usr/local/lib/python3.6/site-packages/social_django/utils.py", line 49, in wrapper
    return func(request, backend,
    args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/social_django/views.py", line 23, in auth
    return do_auth(request.backend, redirect_name=REDIRECT_FIELD_NAME)
    File "/usr/local/lib/python3.6/site-packages/social_core/actions.py", line 27, in do_auth
    return backend.start()
    File "/usr/local/lib/python3.6/site-packages/social_core/backends/base.py", line 35, in start
    return self.strategy.redirect(self.auth_url())
    File "/usr/local/lib/python3.6/site-packages/social_core/backends/oauth.py", line 167, in auth_url
    token = self.set_unauthorized_token()
    File "/usr/local/lib/python3.6/site-packages/social_core/backends/oauth.py", line 223, in set_unauthorized_token
    token = self.unauthorized_token()
    File "/usr/local/lib/python3.6/site-packages/social_core/backends/oauth.py", line 247, in unauthorized_token
    method=self.REQUEST_TOKEN_METHOD
    File "/usr/local/lib/python3.6/site-packages/social_core/backends/base.py", line 234, in request
    response.raise_for_status()
    File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
    requests.exceptions.HTTPError: 401 Client Error: Authorization Required for url: api.twitter.com/oauth/request_token

  • March 28, 2019, 11:14 a.m.

    Did you see this stack overflow discussion? It's pointing to incorrect callback URL. Are you sure the app is not redirecting from http to https, or from URL without slash at the end to one with slash? Both of those redirects are setup on misago-docker and can potentially lose the querystring with token.

    The OAUTH despite being standardized leaves plenty of freedom up to implementors, meaning different sites have quirks and gotchas specific to them. Its very hard to tell what's wrong for Twitter.

  • Members 29 posts
    March 28, 2019, 12:40 p.m.

    Yeah I have done lots of googling. I have already read that and tried all the suggestions. I really don't understand whats going on. I have listed all possible callback urls in the APP and I have set the correct credentials in the forum. Strange.

  • Members 29 posts
    March 29, 2019, 10:31 p.m.

    Still can't find a solution for this problem though. It looks like plenty of others out there have the same problem as me. Something to do with the django package used for social auth.

  • Members 29 posts
    March 30, 2019, 9:53 p.m.

    So I found the error. When you give the settings for twitter it doesn't save it to the configuration file properly it converts it all to lowercase.