Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to new OAuth server #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

jirutka
Copy link
Contributor

@jirutka jirutka commented Nov 28, 2015

Fixes #6, but not tested!

@landscape-bot
Copy link

Code Health
Repository health decreased by 2% when pulling 7a0aeba on jirutka:update-oauth into 7393af4 on hroncok:master.

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling db26b5e on jirutka:update-oauth into 7393af4 on hroncok:master.

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 7f3c0ca on jirutka:update-oauth into 7393af4 on hroncok:master.

@hroncok
Copy link
Owner

hroncok commented Nov 28, 2015

When I want to login, I'm redirected to the new login form, but when redirected back to the application, this happens. I haven't got time to examine why yet.

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/complete/fit/?redirect_state=<long_bullshit>&code=<short_bullshit>&state=<long_bullshit (the same one)>

Django Version: 1.6.11
Python Version: 3.4.1
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'social.apps.django_app.default',
 'signatures',
 'fitauth')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'social.apps.django_app.middleware.SocialAuthExceptionMiddleware')


Traceback:
File "/usr/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
  112.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3.4/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  52.         response = view_func(request, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/django/views/decorators/csrf.py" in wrapped_view
  57.         return view_func(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/social/apps/django_app/utils.py" in wrapper
  52.             return func(request, backend, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/social/apps/django_app/views.py" in complete
  28.                        redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/social/actions.py" in do_complete
  40.         user = backend.complete(user=user, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/social/backends/base.py" in complete
  40.         return self.auth_complete(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/social/backends/oauth.py" in auth_complete
  368.                 method=self.ACCESS_TOKEN_METHOD
File "/usr/lib/python3.4/site-packages/social/backends/oauth.py" in request_access_token
  348.         return self.get_json(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/social/backends/base.py" in get_json
  228.         return self.request(url, *args, **kwargs).json()
File "/usr/lib/python3.4/site-packages/social/backends/base.py" in request
  224.         response.raise_for_status()
File "/usr/lib/python3.4/site-packages/requests/models.py" in raise_for_status
  851.             raise HTTPError(http_error_msg, response=self)

Exception Type: HTTPError at /complete/fit/
Exception Value: 401 Client Error: Unauthorized

@jirutka
Copy link
Contributor Author

jirutka commented Nov 28, 2015

I think that this may be caused by using form authentication instead of Authorization header (see the second point in #6). I don’t have time to look at social.backends.oauth now, maybe later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants