diff options
author | Ib Lundgren <ib.lundgren@gmail.com> | 2013-04-06 02:51:47 -0700 |
---|---|---|
committer | Ib Lundgren <ib.lundgren@gmail.com> | 2013-04-06 02:51:47 -0700 |
commit | bbe26bc46f6e2cf208050a476f6ad09f28bcc8e7 (patch) | |
tree | 7d58ca93d4494852c954d2065f68f0c420fbc10c | |
parent | 93654dcc583df0d7c3b32c922ab5b9fcb0289837 (diff) | |
parent | f90a3bdb79bef5a39322c4d04c1055683ddcc15d (diff) | |
download | oauthlib-bbe26bc46f6e2cf208050a476f6ad09f28bcc8e7.tar.gz |
Merge pull request #132 from johanmeiring/master
Further documentation corrections
-rw-r--r-- | oauthlib/oauth2/draft25/grant_types.py | 7 | ||||
-rw-r--r-- | oauthlib/oauth2/ext/django.py | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/oauthlib/oauth2/draft25/grant_types.py b/oauthlib/oauth2/draft25/grant_types.py index 4897d4c..4fd51f4 100644 --- a/oauthlib/oauth2/draft25/grant_types.py +++ b/oauthlib/oauth2/draft25/grant_types.py @@ -130,7 +130,7 @@ class RequestValidator(object): """Invalidate an authorization code after use. :param client_id: Unicode client identifier - :param code: A dict of the authorization code grant. + :param code: The authorization code grant (request.code). :param request: The HTTP Request (oauthlib.common.Request) Method is used by: @@ -178,11 +178,14 @@ class RequestValidator(object): 'token_type': 'Bearer', 'access_token': 'askfjh234as9sd8', 'expires_in': 3600, - 'scope': ['list', 'of', 'authorized', 'scopes'], + 'scope': 'string of space separated authorized scopes', 'refresh_token': '23sdf876234', # if issued 'state': 'given_by_client', # if supplied by client } + Note that while "scope" is a string-separated list of authorized scopes, + the original list is still available in request.scopes + :param client_id: Unicode client identifier :param token: A Bearer token dict :param request: The HTTP Request (oauthlib.common.Request) diff --git a/oauthlib/oauth2/ext/django.py b/oauthlib/oauth2/ext/django.py index f68f67f..9c0e3e5 100644 --- a/oauthlib/oauth2/ext/django.py +++ b/oauthlib/oauth2/ext/django.py @@ -24,8 +24,10 @@ class OAuth2ProviderDecorator(object): uri = request.build_absolute_uri() http_method = request.method headers = request.META - del headers['wsgi.input'] - del headers['wsgi.errors'] + if 'wsgi.input' in headers: + del headers['wsgi.input'] + if 'wsgi.errors' in headers: + del headers['wsgi.errors'] if 'HTTP_AUTHORIZATION' in headers: headers['Authorization'] = headers['HTTP_AUTHORIZATION'] body = urlencode(request.POST.items()) @@ -86,7 +88,7 @@ class OAuth2ProviderDecorator(object): url, headers, body, status = self._token_endpoint.create_token_response( uri, http_method, body, headers, credentials) response = HttpResponse(content=body, status=status) - for k, v in headers: + for k, v in headers.items(): response[k] = v return response return wrapper |