@marknca
unread,Sep 12, 2009, 3:48:32 PM9/12/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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