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

def openid::consumer::consumer::GenericConsumer::_createAssociateRequest (   self,
  endpoint,
  assoc_type,
  session_type 
) [private]

Create an association request for the given assoc_type and
session_type.

@param endpoint: The endpoint whose server_url will be
    queried. The important bit about the endpoint is whether
    it's in compatiblity mode (OpenID 1.1)

@param assoc_type: The association type that the request
    should ask for.
@type assoc_type: str

@param session_type: The session type that should be used in
    the association request. The session_type is used to
    create an association session object, and that session
    object is asked for any additional fields that it needs to
    add to the request.
@type session_type: str

@returns: a pair of the association session object and the
    request message that will be sent to the server.
@rtype: (association session type (depends on session_type),
 openid.message.Message)

Definition at line 1181 of file consumer.py.

01181                                                                          :
        """Create an association request for the given assoc_type and
        session_type.

        @param endpoint: The endpoint whose server_url will be
            queried. The important bit about the endpoint is whether
            it's in compatiblity mode (OpenID 1.1)

        @param assoc_type: The association type that the request
            should ask for.
        @type assoc_type: str

        @param session_type: The session type that should be used in
            the association request. The session_type is used to
            create an association session object, and that session
            object is asked for any additional fields that it needs to
            add to the request.
        @type session_type: str

        @returns: a pair of the association session object and the
            request message that will be sent to the server.
        @rtype: (association session type (depends on session_type),
                 openid.message.Message)
        """
        session_type_class = self.session_types[session_type]
        assoc_session = session_type_class()

        args = {
            'mode': 'associate',
            'assoc_type': assoc_type,
            }

        if not endpoint.compatibilityMode():
            args['ns'] = OPENID2_NS

        # Leave out the session type if we're in compatibility mode
        # *and* it's no-encryption.
        if (not endpoint.compatibilityMode() or
            assoc_session.session_type != 'no-encryption'):
            args['session_type'] = assoc_session.session_type

        args.update(assoc_session.getRequest())
        message = Message.fromOpenIDArgs(args)
        return assoc_session, message

    def _getOpenID1SessionType(self, assoc_response):


Generated by  Doxygen 1.6.0   Back to index