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

def openid::consumer::consumer::Consumer::begin (   self,
  user_url,
  anonymous = False 
)

Start the OpenID authentication process. See steps 1-2 in
the overview at the top of this file.

@param user_url: Identity URL given by the user. This method
    performs a textual transformation of the URL to try and
    make sure it is normalized. For example, a user_url of
    example.com will be normalized to http://example.com/
    normalizing and resolving any redirects the server might
    issue.

@type user_url: unicode

@param anonymous: Whether to make an anonymous request of the OpenID
    provider.  Such a request does not ask for an authorization
    assertion for an OpenID identifier, but may be used with
    extensions to pass other data.  e.g. "I don't care who you are,
    but I'd like to know your time zone."

@type anonymous: bool

@returns: An object containing the discovered information will
    be returned, with a method for building a redirect URL to
    the server, as described in step 3 of the overview. This
    object may also be used to add extension arguments to the
    request, using its
    L{addExtensionArg<openid.consumer.consumer.AuthRequest.addExtensionArg>}
    method.

@returntype: L{AuthRequest<openid.consumer.consumer.AuthRequest>}

@raises openid.consumer.discover.DiscoveryFailure: when I fail to
    find an OpenID server for this URL.  If the C{yadis} package
    is available, L{openid.consumer.discover.DiscoveryFailure} is
    an alias for C{yadis.discover.DiscoveryFailure}.

Definition at line 286 of file consumer.py.

00286                                               :
        """Start the OpenID authentication process. See steps 1-2 in
        the overview at the top of this file.

        @param user_url: Identity URL given by the user. This method
            performs a textual transformation of the URL to try and
            make sure it is normalized. For example, a user_url of
            example.com will be normalized to http://example.com/
            normalizing and resolving any redirects the server might
            issue.

        @type user_url: unicode

        @param anonymous: Whether to make an anonymous request of the OpenID
            provider.  Such a request does not ask for an authorization
            assertion for an OpenID identifier, but may be used with
            extensions to pass other data.  e.g. "I don't care who you are,
            but I'd like to know your time zone."

        @type anonymous: bool

        @returns: An object containing the discovered information will
            be returned, with a method for building a redirect URL to
            the server, as described in step 3 of the overview. This
            object may also be used to add extension arguments to the
            request, using its
            L{addExtensionArg<openid.consumer.consumer.AuthRequest.addExtensionArg>}
            method.

        @returntype: L{AuthRequest<openid.consumer.consumer.AuthRequest>}

        @raises openid.consumer.discover.DiscoveryFailure: when I fail to
            find an OpenID server for this URL.  If the C{yadis} package
            is available, L{openid.consumer.discover.DiscoveryFailure} is
            an alias for C{yadis.discover.DiscoveryFailure}.
        """
        disco = Discovery(self.session, user_url, self.session_key_prefix)
        try:
            service = disco.getNextService(self._discover)
        except fetchers.HTTPFetchingError, why:
            raise DiscoveryFailure(
                'Error fetching XRDS document: %s' % (why[0],), None)

        if service is None:
            raise DiscoveryFailure(
                'No usable OpenID services found for %s' % (user_url,), None)
        else:
            return self.beginWithoutDiscovery(service, anonymous)

    def beginWithoutDiscovery(self, service, anonymous=False):


Generated by  Doxygen 1.6.0   Back to index