Logo Search packages:      
Sourcecode: ubuntu-sso-client version File versions  Download package

def ubuntu_sso::auth::TemporaryTwistedWebServer::render_GET (   self,
  request 
)

Handle incoming web requests

Definition at line 445 of file auth.py.

00445                                  :
        """Handle incoming web requests"""
        logger.debug("Incoming temp webserver hit received")
        nonce = request.args.get("nonce", [None])[0]
        url = request.args.get("return", ["https://one.ubuntu.com/"])[0]
        verifier = request.args.get("oauth_verifier", [None])[0]
        logger.debug("Got verifier %s" % verifier)
        if nonce and (str(nonce) == str(self.nonce) and verifier):
            self.retrieve_function(store=self.store_yes_no, verifier=verifier)
            reactor.callLater(3, self.stop)
            return """<!doctype html>
        <html><head><meta http-equiv="refresh"
        content="0;url=%(url)s">
        </head>
        <body>
        <p>You should now automatically <a
        href="%(url)s">return to %(url)s</a>.</p>
        </body>
        </html>
        """ % { 'url' : url }
        else:
            self.retrieve_function(store=self.store_yes_no, verifier=verifier)
            reactor.callLater(3, self.stop)
            request.setResponseCode(400)
            return """<!doctype html>
        <html><head><title>Error</title></head>
        <body>
        <h1>There was an error</h1>
        <p>The authentication process has not succeeded. This may be a
        temporary problem; please try again in a few minutes.</p>
        </body>
        </html>
        """





Generated by  Doxygen 1.6.0   Back to index