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

def openid::consumer::consumer::GenericConsumer::_discoverAndVerify (   self,
  to_match 
) [private]

Given an endpoint object created from the information in an
OpenID response, perform discovery and verify the discovery
results, returning the matching endpoint that is the result of
doing that discovery.

@type to_match: openid.consumer.discover.OpenIDServiceEndpoint
@param to_match: The endpoint whose information we're confirming

@rtype: openid.consumer.discover.OpenIDServiceEndpoint
@returns: The result of performing discovery on the claimed
    identifier in `to_match'

@raises ProtocolError: when discovery fails.

Definition at line 950 of file consumer.py.

00950                                           :
        """Given an endpoint object created from the information in an
        OpenID response, perform discovery and verify the discovery
        results, returning the matching endpoint that is the result of
        doing that discovery.

        @type to_match: openid.consumer.discover.OpenIDServiceEndpoint
        @param to_match: The endpoint whose information we're confirming

        @rtype: openid.consumer.discover.OpenIDServiceEndpoint
        @returns: The result of performing discovery on the claimed
            identifier in `to_match'

        @raises ProtocolError: when discovery fails.
        """
        oidutil.log('Performing discovery on %s' % (to_match.claimed_id,))
        _, services = self._discover(to_match.claimed_id)
        if not services:
            raise DiscoveryFailure('No OpenID information found at %s' %
                                   (to_match.claimed_id,), None)

        # Search the services resulting from discovery to find one
        # that matches the information from the assertion
        failure_messages = []
        for endpoint in services:
            try:
                self._verifyDiscoverySingle(endpoint, to_match)
            except ProtocolError, why:
                failure_messages.append(why[0])
            else:
                # It matches, so discover verification has
                # succeeded. Return this endpoint.
                return endpoint
        else:
            oidutil.log('Discovery verification failure for %s' %
                        (to_match.claimed_id,))
            for failure_message in failure_messages:
                oidutil.log(' * Endpoint mismatch: ' + failure_message)

            raise DiscoveryFailure(
                'No matching endpoint found after discovering %s'
                % (to_match.claimed_id,), None)

    def _checkAuth(self, message, server_url):


Generated by  Doxygen 1.6.0   Back to index