:: İstemci kimlik doğrulaması Xmlrpc nasıl

2 Cevap php

Ben doğrulanmış gereken bir XMLRPC isteği yapmak gerekiyor ve Xmlrpc kimlik doğrulama tarafında sınırlı belgeleri bulduk. Bu konuda gitmek için en iyi yolu nedir? Şu anda aşağıdaki kodu kullanıyorum ama hala bir kimlik doğrulama hatası alıyorum. Istemci belirtmek için farklı bir yolu var mı, bir süre sonra ikincil kimlik doğrulama yöntemini çağırın?

client = XMLRPC::Client.new(@xmlrpc_url, "/xmlrpc.php", "443", nil, nil, @username, @password, true, 900)

2 Cevap

...I'm using the code below but still getting an authentication failure

Uzak webserver kaynak /xmlrpc.php için HTTP Temel kimlik doğrulaması kabul, ve daha da kabul ettiğini olduğundan iki kere kontrol edin @username ve @password.

Bu gibi temel Auth ile docs, bir RPC için XMLRPC incantation client.call("bwizzy") üretecektir bir şey başına:

POST /xmlrpc.php HTTP/1.1
User-Agent: XMLRPC::Client (Ruby 1.9.1)
Content-Type: text/xml; charset=utf-8
Content-Length: 88
Connection: keep-alive
Authorization: Basic c3RhY2s6b3ZlcmZsb3c=
Accept: */*
Host: localhost

<?xml version="1.0"><methodCall><methodName>bwizzy</methodName></params></methodCall>

(Bu başlıklardan sipariş hakkında bana şikayet etmeyin - ben tel üzerinde görmek ne :)!)

Şimdi, XML-RPC kendisi kimlik doğrulaması için sağlamaz, bu yüzden birkaç genel seçeneğiniz var:

  1. Use typical "web auth" techniques
    HTTP Authorization schemes, like you are currently using. Trusted client-side certs. Cookie authentication tokens. Etc.
    Typical web auth techniques carry common risks, however. Poke around SO for more guidance here.

  2. Extend the RPC functions to support user-defined auth
    For example, the RPC call bwizzy might take a username and password as arguments.
    Or a login RPC function might generate a time-limited token to be used as a Cookie.
    This approach is invasive -- now your RPC calls have to be auth-aware -- and error-prone -- now you have to implement auth yourself.

  3. Extend XML-RPC itself
    The XML RPC calls could be themselves signed or signed and encrypted, for example, ala SOAP's digital signatures

IXR içine bakıyor http://scripts.incutio.com/xmlrpc/basic-server-construction.php temel kimlik doğrulaması yapmak için nasıl gösterir ama çok güvenli görünmüyor