コード例 #1
0
ファイル: webpage.py プロジェクト: Cloudxtreme/OpenWiFi
    def POST(self):
        # unlike the usual scheme of things, the POST is actually called
        # first here
        i = web.input(return_to='/')
        if i.get('action') == 'logout':
            web.webopenid.logout()
            return web.redirect(i.return_to)

        i = web.input('openid', return_to='/')
        going = owevent.going_to_auth(owglobal.session.datapath,
                                      owglobal.session.host, i['openid'])
        owglobal.server.post_event(going)
        output.dbg(str(owglobal.session.host)+\
                       " is going to "+going.server()+" to authenticate",
                   self.__class__.__name__)

        n = web.webopenid._random_session()
        web.webopenid.sessions[n] = {'webpy_return_to': i.return_to}

        c = openid.consumer.consumer.Consumer(web.webopenid.sessions[n],
                                              web.webopenid.store)
        a = c.begin(i.openid)
        f = a.redirectURL(web.ctx.home, web.ctx.home + web.ctx.fullpath)

        web.setcookie('openid_session_id', n)
        return web.redirect(f)
コード例 #2
0
ファイル: webpage.py プロジェクト: carriercomm/OpenWiFi
    def POST(self):
        # unlike the usual scheme of things, the POST is actually called
        # first here
        i = web.input(return_to='/')
        if i.get('action') == 'logout':
            web.webopenid.logout()
            return web.redirect(i.return_to)

        i = web.input('openid', return_to='/')
        going = owevent.going_to_auth(owglobal.session.datapath,
                                      owglobal.session.host,
                                      i['openid'])
        owglobal.server.post_event(going)
        output.dbg(str(owglobal.session.host)+\
                       " is going to "+going.server()+" to authenticate",
                   self.__class__.__name__)

        n = web.webopenid._random_session()
        web.webopenid.sessions[n] = {'webpy_return_to': i.return_to}
        
        c = openid.consumer.consumer.Consumer(web.webopenid.sessions[n], 
                                              web.webopenid.store)
        a = c.begin(i.openid)
        f = a.redirectURL(web.ctx.home, web.ctx.home + web.ctx.fullpath)

        web.setcookie('openid_session_id', n)
        return web.redirect(f)
コード例 #3
0
 def GET(self):
     going = owevent.going_to_auth(owglobal.session.datapath,
                                   owglobal.session.host, "facebook")
     owglobal.server.post_event(going)
     output.dbg(str(owglobal.session.host)+\
                    " is going to "+going.server()+" to authenticate",
                self.__class__.__name__)
     return fb.login.GET(self)
コード例 #4
0
 def GET(self):
     going = owevent.going_to_auth(owglobal.session.datapath,
                                   owglobal.session.host,
                                   "facebook")
     owglobal.server.post_event(going)
     output.dbg(str(owglobal.session.host)+\
                    " is going to "+going.server()+" to authenticate",
                self.__class__.__name__)
     return fb.login.GET(self)