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

佐手、 提交于 2019-12-07 02:29:03

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/2956778/how-do-i-implement-secure-authentication-using-xml-rpc-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!