Logo Search packages:      
Sourcecode: python-openid version File versions

def openid::consumer::consumer::GenericConsumer::_checkReturnTo (   self,
  message,
  return_to 
) [private]

Check an OpenID message and its openid.return_to value
against a return_to URL from an application.  Return True on
success, False on failure.

Definition at line 602 of file consumer.py.

00602                                                 :
        """Check an OpenID message and its openid.return_to value
        against a return_to URL from an application.  Return True on
        success, False on failure.
        """
        # Check the openid.return_to args against args in the original
        # message.
        try:
            self._verifyReturnToArgs(message.toPostArgs())
        except ProtocolError, why:
            oidutil.log("Verifying return_to arguments: %s" % (why[0],))
            return False

        # Check the return_to base URL against the one in the message.
        msg_return_to = message.getArg(OPENID_NS, 'return_to')

        # The URL scheme, authority, and path MUST be the same between
        # the two URLs.
        app_parts = urlparse(return_to)
        msg_parts = urlparse(msg_return_to)

        # (addressing scheme, network location, path) must be equal in
        # both URLs.
        for part in range(0, 3):
            if app_parts[part] != msg_parts[part]:
                return False

        return True

    _makeKVPost = staticmethod(makeKVPost)


Generated by  Doxygen 1.6.0   Back to index