且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何使用Python中的XML-RPC实现安全认证?

更新时间:2023-02-11 11:58:16

您可以检出的这code为通过HTTPS 一个简单的XML-RPC服务器。认证可以在任何你希望的方式工作......他们可以做一些凭​​证进行身份验证和您提供的会话的其余部分的cookie。

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.

借助 Python文档为XMLRPC 包括使用HTTP授权报头的细节传递凭据。

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

下面是一些code使用的扭曲 实施xmlrpc的身份验证机制,它可以很容易地使用HTTPS而不是HTTP。

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

这家伙写了一个HTTPS XML-RPC设置与授权,你可以下载。
有吨资源,这样做这是容易googleable的方法。这一切都取决于如果你正在使用的mod_wsgi例如,或写入使用双绞线一个独立的服务器。

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.

底线:

A)使用SSL通信结果
B)使用HTTP授权机制

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