omab / python-social-auth

Social auth made simple
http://psa.matiasaguirre.net
BSD 3-Clause "New" or "Revised" License
2.83k stars 1.09k forks source link

add support for gitlab auth #1011

Closed glensc closed 7 years ago

glensc commented 8 years ago

should support https://gitlab.com/ and on premises installation (custom urls)

i tried to make own using this blog: http://widerin.net/blog/weblate-gitlab-oauth-login/

in weblate, but got some errors:

weblate_1   | ERROR Internal Server Error: /accounts/complete/GitLab/
weblate_1   | Traceback (most recent call last):
weblate_1   |   File "/app/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 39, in inner
weblate_1   |     response = get_response(request)
weblate_1   |   File "/app/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
weblate_1   |     response = self._get_response(request)
weblate_1   |   File "/app/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
weblate_1   |     response = self.process_exception_by_middleware(e, request)
weblate_1   |   File "/app/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
weblate_1   |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
weblate_1   |   File "/app/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
weblate_1   |     response = view_func(request, *args, **kwargs)
weblate_1   |   File "/app/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
weblate_1   |     return view_func(*args, **kwargs)
weblate_1   |   File "/app/local/lib/python2.7/site-packages/social/apps/django_app/utils.py", line 51, in wrapper
weblate_1   |     return func(request, backend, *args, **kwargs)
weblate_1   |   File "/app/local/lib/python2.7/site-packages/social/apps/django_app/views.py", line 28, in complete
weblate_1   |     redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
weblate_1   |   File "/app/local/lib/python2.7/site-packages/social/actions.py", line 44, in do_complete
weblate_1   |     user = backend.complete(user=user, *args, **kwargs)
weblate_1   |   File "/app/local/lib/python2.7/site-packages/social/backends/base.py", line 41, in complete
weblate_1   |     return self.auth_complete(*args, **kwargs)
weblate_1   |   File "/app/local/lib/python2.7/site-packages/social/utils.py", line 246, in wrapper
weblate_1   |     return func(*args, **kwargs)
weblate_1   |   File "/app/local/lib/python2.7/site-packages/social/backends/oauth.py", line 385, in auth_complete
weblate_1   |     state = self.validate_state()
weblate_1   |   File "/app/local/lib/python2.7/site-packages/social/backends/oauth.py", line 88, in validate_state
weblate_1   |     raise AuthStateMissing(self, 'state')
weblate_1   | AuthStateMissing: Session value state missing.

so yeah, maybe some one more familiar with psa can add it to be included in distribution and be documented

glensc commented 7 years ago

in what category this bug should be resubmitted? core?

https://github.com/python-social-auth/social-core

omab commented 7 years ago

Under the feature label is fine.