Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I implement secure authentication using xml-rpc in python?

I have a basic xml-rpc web service service running.
What is the simplest way(I'm a newbie) to implement secure authentication?

I just need some direction.

like image 440
Nullpoet Avatar asked Jun 02 '10 10:06

Nullpoet


People also ask

How do I use RPC in Python?

Remote Procedure Call (RPC) system enables you to call a function available on a remote server using the same syntax which is used when calling a function in a local library. This is useful in two situations.

Which method does XML-RPC uses to send the request?

XML-RPC is a Remote Procedure Call method that uses XML passed via HTTP(S) as a transport. With it, a client can call methods with parameters on a remote server (the server is named by a URI) and get back structured data.

What is XML-RPC used for?

XML-RPC is a specification that enables communication between WordPress and other systems. It did this by standardizing those communications, using HTTP as the transport mechanism and XML as the encoding mechanism.

What is XML-RPC and JSON RPC?

It is similar to the XML-RPC protocol, defining only a few data types and commands. JSON-RPC allows for notifications (data sent to the server that does not require a response) and for multiple calls to be sent to the server which may be answered asynchronously.


1 Answers

You could checkout This code for a simple XML-RPC server over HTTPS. Authentication can work in any way you wish ... they could authenticate with some credentials and you provide a cookie for the rest of the session.

The Python docs for xmlrpc include details of using the HTTP 'Authorization' header for passing in credentials.

Here is some code that uses Twisted to implement a xmlrpc auth mechanism, which could easily use HTTPS instead of HTTP.

This guy has written a HTTPS XML-RPC setup with authorization which you can download. There are tons of resources, and ways of doing this which are easily googleable. This all depends on if you are using mod_wsgi for example, or writing a standalone server using Twisted.

Bottom line:

a) Use SSL for communication
b) Use the HTTP authorization mechanism

like image 109
Aiden Bell Avatar answered Sep 16 '22 11:09

Aiden Bell