lenarother / django-centralauth Goto Github PK
View Code? Open in Web Editor NEWCentralized authentication / authorization
License: MIT License
Centralized authentication / authorization
License: MIT License
Please check if we can do without storing the access token lifetime. Maybe oauthlib / requests-oauthlib makes this obsolete anyway.
Please use django.contrib.auth.views.LoginView
in the provider example so users don't need is_staff
.
Add tox and Travis CI configuration to ensure older Django versions work too. This is only required for the client part. The provider tests might be skipped on Django < 2.1.
We'd like the client to sync the user frequently (i.e. every 5 minutes).
In the middleware, we check the validity of the access token. If the token is expired, we redirect to login via centralauth but not logging out the user. This needs to be added.
Traceback (most recent call last):
File "/usr/local/bin/django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.4/site-packages/raven/contrib/django/management/__init__.py", line 41, in new_execute
return original_func(self, *args, **kwargs)
File "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.4/site-packages/centralauth/client/management/commands/sync_perms.py", line 22, in handle
response_json = response.json()
File "/usr/local/lib/python3.4/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.4/site-packages/simplejson/__init__.py", line 518, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.4/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python3.4/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 5 column 1 (char 4)
Sentry is attempting to send 1 pending error messages
Add sync_users or improve sync_perms command to enable creating users in project through centralauth so that they appear in project admin even if they have no permissions.
response = client.get(redirect, secure=True)
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/django/test/client.py:527: in get
response = super().get(path, data=data, secure=secure, **extra)
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/django/test/client.py:339: in get
**extra,
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/django/test/client.py:414: in generic
return self.request(**r)
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/django/test/client.py:495: in request
raise exc_value
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/django/core/handlers/exception.py:34: in inner
response = get_response(request)
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/django/core/handlers/base.py:126: in _get_response
response = self.process_exception_by_middleware(e, request)
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/django/core/handlers/base.py:124: in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/django/views/generic/base.py:68: in view
return self.dispatch(request, *args, **kwargs)
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/django/views/generic/base.py:88: in dispatch
return handler(request, *args, **kwargs)
centralauth/client/views.py:68: in get
client_secret=settings.CENTRALAUTH_CLIENT_SECRET,
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/requests_oauthlib/oauth2_session.py:307: in fetch_token
self._client.parse_request_body_response(r.text, scope=self.scope)
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/clients/base.py:415: in parse_request_body_response
self.token = parse_token_response(body, scope=scope)
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/parameters.py:425: in parse_token_response
validate_token_parameters(params)
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/parameters.py:432: in validate_token_parameters
raise_from_error(params.get('error'), params)
../../.virtualenvs/django-centralauth-8xEOLZjf/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/errors.py:405: in raise_from_error
raise cls(**kwargs)
E oauthlib.oauth2.rfc6749.errors.InvalidClientError: (invalid_client)```
We need to add more tests to ensure the have all critical parts covered by tests.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.