Permalink
Browse files

more oob changes

  • Loading branch information...
1 parent e200903 commit ae53615750c14c6f10c03f25eadaae4878ae0bdc @ewdurbin ewdurbin committed Jul 30, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 tornado/auth.py
View
@@ -289,7 +289,9 @@ def _oauth_request_token_url(self, callback_uri=None, extra_params=None):
oauth_version=getattr(self, "_OAUTH_VERSION", "1.0a"),
)
if getattr(self, "_OAUTH_VERSION", "1.0a") == "1.0a":
- if callback_uri:
+ if callback_uri == "oob":
+ args["oauth_callback"] = "oob"
+ elif callback_uri:
args["oauth_callback"] = urlparse.urljoin(
self.request.full_url(), callback_uri)
if extra_params:
@@ -309,7 +311,10 @@ def _on_request_token(self, authorize_url, callback_uri, response):
base64.b64encode(request_token["secret"]))
self.set_cookie("_oauth_request_token", data)
args = dict(oauth_token=request_token["key"])
- if callback_uri:
+ if callback_uri == "oob":
+ self.finish(authorize_url + "?" + urllib.urlencode(args))
+ return
+ elif callback_uri:
args["oauth_callback"] = urlparse.urljoin(
self.request.full_url(), callback_uri)
self.redirect(authorize_url + "?" + urllib.urlencode(args))

0 comments on commit ae53615

Please sign in to comment.