OpenIdMixin

47 views
Skip to first unread message

@marknca

unread,
Sep 12, 2009, 3:48:32 PM9/12/09
to Tornado Web Server
Has anyone had any luck w/using the auth.OpenIdMixin for generic
OpenId authentication? I've successfully used the demo apps to get
Google-based authentication (openid & oauth) working but no luck when
using the auth.OpenIdMixin.

I've modified the authdemo.py code to be:

class AuthHandler(BaseHandler, tornado.auth.OpenIdMixin):
_OPENID_ENDPOINT = "my open id url here/"

@tornado.web.asynchronous
def get(self):
if self.get_argument("openid.mode", None):
self.get_authenticated_user(self.async_callback
(self._on_auth))
return
self.authenticate_redirect()

def _on_auth(self, user):
if not user:
raise tornado.web.HTTPError(500, "Google auth failed")
self.set_secure_cookie("user", tornado.escape.json_encode
(user))
self.redirect("/")

Where _OPENID_ENDPOINT was hard coded to an valid, active openid. The
redirect works correctly but it only displays the openid page, it does
not make a openid request to that url.

Any pointer/help would be greatly appreciated!

Thanks,
Mark

@marknca

unread,
Sep 13, 2009, 3:19:43 PM9/13/09
to Tornado Web Server
Following up to my own question, the issue seems to be that the
OpenIdMixin is making a GET request to the end point and not a POST.

If I pass an auth.HTTPRequest open where method="POST", it still makes
a "GET" request. Ideas?

Bret Taylor

unread,
Sep 13, 2009, 3:23:54 PM9/13/09
to python-...@googlegroups.com
I will look into this, thanks for the bug report.

Stev-a

unread,
Oct 24, 2009, 12:19:21 PM10/24/09
to Tornado Web Server
Im also trying the same thing, any solutions to this yet ?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages