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

def openid::consumer::consumer::Consumer::complete (   self,
  query,
  return_to = None 
)

Called to interpret the server's response to an OpenID
request. It is called in step 4 of the flow described in the
consumer overview.

@param query: A dictionary of the query parameters for this
    HTTP request.

@param return_to: The return URL used to invoke the
    application.  Extract the URL from your application's web
    request framework and specify it here to have it checked
    against the openid.return_to value in the response.  If
    the return_to URL check fails, the status of the
    completion will be FAILURE.

@returns: a subclass of Response. The type of response is
    indicated by the status attribute, which will be one of
    SUCCESS, CANCEL, FAILURE, or SETUP_NEEDED.

@see: L{SuccessResponse<openid.consumer.consumer.SuccessResponse>}
@see: L{CancelResponse<openid.consumer.consumer.CancelResponse>}
@see: L{SetupNeededResponse<openid.consumer.consumer.SetupNeededResponse>}
@see: L{FailureResponse<openid.consumer.consumer.FailureResponse>}

Definition at line 366 of file consumer.py.

00366                                              :
        """Called to interpret the server's response to an OpenID
        request. It is called in step 4 of the flow described in the
        consumer overview.

        @param query: A dictionary of the query parameters for this
            HTTP request.

        @param return_to: The return URL used to invoke the
            application.  Extract the URL from your application's web
            request framework and specify it here to have it checked
            against the openid.return_to value in the response.  If
            the return_to URL check fails, the status of the
            completion will be FAILURE.

        @returns: a subclass of Response. The type of response is
            indicated by the status attribute, which will be one of
            SUCCESS, CANCEL, FAILURE, or SETUP_NEEDED.

        @see: L{SuccessResponse<openid.consumer.consumer.SuccessResponse>}
        @see: L{CancelResponse<openid.consumer.consumer.CancelResponse>}
        @see: L{SetupNeededResponse<openid.consumer.consumer.SetupNeededResponse>}
        @see: L{FailureResponse<openid.consumer.consumer.FailureResponse>}
        """

        endpoint = self.session.get(self._token_key)
        if endpoint is None:
            response = FailureResponse(None, 'No session state found')
        else:
            message = Message.fromPostArgs(query)
            response = self.consumer.complete(message, endpoint, return_to)
            del self.session[self._token_key]

        if (response.status in ['success', 'cancel'] and
            response.identity_url is not None):

            disco = Discovery(self.session,
                              response.identity_url,
                              self.session_key_prefix)
            # This is OK to do even if we did not do discovery in
            # the first place.
            disco.cleanup()

        return response

    def setAssociationPreference(self, association_preferences):


Generated by  Doxygen 1.6.0   Back to index