diff options
| author | Fernando Rocha | 2013-03-27 19:00:36 -0300 |
|---|---|---|
| committer | Fernando Rocha | 2013-03-27 19:00:36 -0300 |
| commit | b2cea84fae4f721e8eb6432b3d1bab1309e21a00 (patch) | |
| tree | 69f163e1ad4d495507ba8bbe826e0e1d8dfaec3c /rest_framework/authentication.py | |
| parent | f1b8fee4f1e0ea2503d4e0453bdc3049edaa2598 (diff) | |
| download | django-rest-framework-b2cea84fae4f721e8eb6432b3d1bab1309e21a00.tar.bz2 | |
Complete remove of client checks from oauth2
Signed-off-by: Fernando Rocha <fernandogrd@gmail.com>
Diffstat (limited to 'rest_framework/authentication.py')
| -rw-r--r-- | rest_framework/authentication.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/rest_framework/authentication.py b/rest_framework/authentication.py index f4626a2e..145d4295 100644 --- a/rest_framework/authentication.py +++ b/rest_framework/authentication.py @@ -316,19 +316,11 @@ class OAuth2Authentication(BaseAuthentication): """ Authenticate the request, given the access token. """ - client = None - - # Authenticate the client - if 'client_id' in request.REQUEST: - oauth2_client_form = oauth2_provider_forms.ClientAuthForm(request.REQUEST) - if not oauth2_client_form.is_valid(): - raise exceptions.AuthenticationFailed('Client could not be validated') - client = oauth2_client_form.cleaned_data.get('client') try: token = oauth2_provider.models.AccessToken.objects.select_related('user') - if client is not None: - token = token.filter(client=client) + # TODO: Change to timezone aware datetime when oauth2_provider add + # support to it. token = token.get(token=access_token, expires__gt=datetime.now()) except oauth2_provider.models.AccessToken.DoesNotExist: raise exceptions.AuthenticationFailed('Invalid token') |
