Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to use checkid_immediate by setting openid_immediate=True #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions velruse/providers/openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand All @@ -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)
Expand Down