XMLRPC Authentication

Justin Johnson justinjohnson at fastmail.fm
Fri Jun 6 16:13:33 EDT 2003


I'm getting closer.  Now I'm getting the following error when trying to
connect via the client.

[snip]
Traceback (most recent call last):
  File "C:\share\python\uhg\uht\tsd\ClearCase\xmlrpc_client.py", line 7,
  in ?
    print server.runCmd("dir")
  File "C:\Python23\lib\xmlrpclib.py", line 1021, in __call__
    return self.__send(self.__name, args)
  File "C:\Python23\lib\xmlrpclib.py", line 1308, in __request
    verbose=self.__verbose
TypeError: request() got an unexpected keyword argument 'verbose'
[/snip]

I've my code.  Any ideas.

On Fri, 06 Jun 2003 13:34:28 -0600, "Justin Johnson"
<justinjohnson at fastmail.fm> said:
> Ahhh,  okay....
> 
> So I would put code the do_POST to basically read the MD5 hashed
> userid:password, decrypt it, and verify that it is a valid user id and
> password?
> 
> On Fri, 6 Jun 2003 14:00:15 -0700 (PDT), dave at pythonapocrypha.com said:
> > On Fri, 6 Jun 2003, Justin Johnson wrote:
> > 
> > > How do you specify the login id and password required on the server side?
> > >  The code I'm using is similar to the following.  I'm obviously missing
> > > something here... :-(  Thanks for your help.
> > >
> > > # Server code
> > >
> > > import SimpleXMLRPCServer
> > > from ccservice import CCService # A class providing methods for remote
> > > use
> > >
> > > server = SimpleXMLRPCServer.SimpleXMLRPCServer(("somehost", 8000))
> > > server.register_instance(CCService())
> > > server.serve_forever()
> > 
> > Sorry for not more of a detailed answer, but subclass
> > SimpleXMLRPCRequestHandler and override the do_POST method sorta like
> > this psuedo-code
> > 
> > def do_POST(self):
> >   Look at self.headers['authorization']
> >   if missing or wrong:
> >     self.send_response(401)
> >     self.end_headers()
> >     return
> >   # Otherwise call original
> >   return SimpleXMLRPCRequestHandler.do_POST(self)
> > 
> > (where "missing or wrong" = do the inverse of what the client side does
> > to
> > create the Authorization header)
> > 
> > -Dave
> > 
> > -- 
> > http://mail.python.org/mailman/listinfo/python-list
> > 
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmlrpc_server.py
Type: application/unknown
Size: 284 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030606/3df39684/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmlrpc_client.py
Type: application/unknown
Size: 205 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030606/3df39684/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myxmlrpc.py
Type: application/unknown
Size: 537 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030606/3df39684/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BasicAuthTransport.py
Type: application/unknown
Size: 1092 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030606/3df39684/attachment-0003.bin>


More information about the Python-list mailing list