summaryrefslogtreecommitdiff
path: root/oauthlib/oauth1/rfc5849/endpoints/authorization.py
diff options
context:
space:
mode:
authorTyler Jones <tyler@gumstix.com>2013-08-01 11:11:10 -0700
committerTyler Jones <tyler@gumstix.com>2013-08-01 11:11:10 -0700
commitc4a6c31ba9748947462e8e31e106215cca1d3cc9 (patch)
tree71fb95b2f9758527bc1ee17e66efd17f98780c30 /oauthlib/oauth1/rfc5849/endpoints/authorization.py
parent6efc8c04e46d5a731962e2fae9b9599097c5a2d4 (diff)
downloadoauthlib-c4a6c31ba9748947462e8e31e106215cca1d3cc9.tar.gz
#199 Proposed API changes for endpoints.
Diffstat (limited to 'oauthlib/oauth1/rfc5849/endpoints/authorization.py')
-rw-r--r--oauthlib/oauth1/rfc5849/endpoints/authorization.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/oauthlib/oauth1/rfc5849/endpoints/authorization.py b/oauthlib/oauth1/rfc5849/endpoints/authorization.py
index cb3d173..7880711 100644
--- a/oauthlib/oauth1/rfc5849/endpoints/authorization.py
+++ b/oauthlib/oauth1/rfc5849/endpoints/authorization.py
@@ -63,17 +63,16 @@ class AuthorizationEndpoint(BaseEndpoint):
:param headers: The request headers as a dict.
:param credentials: A list of credentials to include in the verifier.
:returns: A tuple of 4 elements.
- 1. The URI to be used to redirect the user back to client.
- 2. A dict of headers to set on the response.
- 3. The response body as a string.
- 4. The response status code as an integer.
+ 1. A dict of headers to set on the response.
+ 2. The response body as a string.
+ 3. The response status code as an integer.
An example of a valid request::
>>> from your_validator import your_validator
>>> from oauthlib.oauth1 import RequestTokenEndpoint
>>> endpoint = RequestTokenEndpoint(your_validator)
- >>> u, h, b, s = endpoint.create_request_token_response(
+ >>> h, b, s = endpoint.create_request_token_response(
... 'https://your.provider/request_token?foo=bar',
... headers={
... 'Authorization': 'OAuth realm=movies user, oauth_....'
@@ -81,10 +80,8 @@ class AuthorizationEndpoint(BaseEndpoint):
... credentials={
... 'extra': 'argument',
... })
- >>> u
- 'https://the.client/callback?oauth_verifier=...&mextra=argument'
>>> h
- {}
+ {'Location': 'https://the.client/callback?oauth_verifier=...&mextra=argument'}
>>> b
''
>>> s
@@ -113,10 +110,10 @@ class AuthorizationEndpoint(BaseEndpoint):
if redirect_uri == 'oob':
response_headers = {'Content-Type': 'application/x-www-form-urlencoded'}
response_body = urlencode(verifier)
- return None, response_headers, response_body, 200
+ return response_headers, response_body, 200
else:
populated_redirect = add_params_to_uri(redirect_uri, verifier.items())
- return populated_redirect, {}, None, 302
+ return {'Location': populated_redirect}, None, 302
def get_realms_and_credentials(self, uri, http_method='GET', body=None,
headers=None):