[Python-modules-commits] [python-social-auth] 01/71: Fix redirect_uri issue with tornado reversed url

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:14:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to tag v0.2.14
in repository python-social-auth.

commit e17367b4e5f865db4947fc4139baa0974d4a7326
Author: Maarten van Schaik <maarten at byte.nl>
Date:   Fri Jul 10 11:08:45 2015 +0200

    Fix redirect_uri issue with tornado reversed url
    
    When reversing URLs, tornado doesn't interpret the regex optional symbol
    '?'. This causes the redirect_uri to be
    https://example.com/complete/mybackend/? with the question mark
    appended. Some providers will simply append to this uri, causing URLs
    like https://example.com/complete/mybackend/??code=.... with two
    question marks. This makes the interpretation of the query string fail.
    
    The provider in this case is
    https://github.com/juanifioren/django-oidc-provider. Arguably that
    library should be smarter in constructing the redirection, but removing
    the question mark from the uri solves these kind of issues.
    
    Alternatively we could strip the question mark from the uri in the
    tornado strategy, but this seemed simpler.
---
 social/apps/tornado_app/routes.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/social/apps/tornado_app/routes.py b/social/apps/tornado_app/routes.py
index 30b7839..b671f9f 100644
--- a/social/apps/tornado_app/routes.py
+++ b/social/apps/tornado_app/routes.py
@@ -5,7 +5,7 @@ from .handlers import AuthHandler, CompleteHandler, DisconnectHandler
 
 SOCIAL_AUTH_ROUTES = [
     url(r'/login/(?P<backend>[^/]+)/?', AuthHandler, name='begin'),
-    url(r'/complete/(?P<backend>[^/]+)/?', CompleteHandler, name='complete'),
+    url(r'/complete/(?P<backend>[^/]+)/', CompleteHandler, name='complete'),
     url(r'/disconnect/(?P<backend>[^/]+)/?', DisconnectHandler,
         name='disconnect'),
     url(r'/disconnect/(?P<backend>[^/]+)/(?P<association_id>\d+)/?',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git



More information about the Python-modules-commits mailing list