wtk
wtk

Reputation: 1031

Using xmlrpclib with cookie obtained different way

How can I use xmlrpclib in Python script to connect to xmlrpc service that requires authentication, but without using xmlrpc authentication?

To be specific:

  1. I use Drupal 7.8, there is of course service modules, I will use it's methods like node.create..

  2. Authentication to any HTTP address on this server is required by Shibboleth SSO

  3. I would like to use services but there is no way of loggin to Shibboleth by xmlrpc (I have to simulate regular living user actions, parse html etc).

  4. I managed to get a cookie (login successful) ready in a variable

  5. Now I want to login to services via xmlrpclib.Server("...") but using the cookie I obtained in different way.

    Is it possible?

Upvotes: 0

Views: 694

Answers (1)

spicavigo
spicavigo

Reputation: 4224

You can modify headers of a request from xmlrpclib client. Create a custom Transport class, and in its send_host method (I think?), you can modify the header to add the cookie you recieved.

EDIT

Check this

Upvotes: 1

Related Questions