XMLRPC Authentication
Justin Johnson
justinjohnson at fastmail.fm
Fri Jun 6 15:34:28 EDT 2003
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
>
More information about the Python-list
mailing list