From 85b95b363fe89a5e7f817bf296fdc1e772e19f61 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Fri, 5 Dec 2014 10:39:10 -0500 Subject: [PATCH] Make it possible to use checkid_immediate by setting openid_immediate=True --- velruse/providers/openid.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/velruse/providers/openid.py b/velruse/providers/openid.py index ae35bfa..f873cbd 100644 --- a/velruse/providers/openid.py +++ b/velruse/providers/openid.py @@ -172,6 +172,7 @@ def login(self, request): # Load default parameters that all Auth Responders take openid_url = request.params.get('openid_identifier') + openid_immediate = request.params.get('openid_immediate', False) # Let inherited consumers alter the openid identifier if desired openid_url = self._lookup_identifier(request, openid_url) @@ -211,14 +212,14 @@ def login(self, request): redirect_url = authrequest.redirectURL( realm=realm, return_to=return_to, - immediate=False) + immediate=openid_immediate) return HTTPFound(location=redirect_url) else: log.debug('About to initiate OpenID POST') html = authrequest.htmlMarkup( realm=realm, return_to=return_to, - immediate=False) + immediate=openid_immediate) return Response(body=html) def _update_profile_data(self, request, user_data, credentials): @@ -237,7 +238,8 @@ def callback(self, request): return_to = request.route_url(self.callback_route) info = oidconsumer.complete(request.params, return_to) - if info.status in [consumer.FAILURE, consumer.CANCEL]: + if info.status in [consumer.FAILURE, consumer.CANCEL, + consumer.SETUP_NEEDED]: return AuthenticationDenied("OpenID failure", provider_name=self.name, provider_type=self.type)