To add authentication to Zend_Soap_Server or Zend_Json_Server, simply specify HTTP authentication in your HTTP server (i.e.: Apache) or the .htaccess file. The following .htaccess file should work:
AuthType Basic
AuthName "Supreme Data Services"
AuthUserFile /var/www/localhost/passwd
Require valid-user
, docroot . htpasswd, Apache. , .
(-), . Zend Framework , SOAP:
$client = new Zend_Soap_Client($wsdl, array('login' => $username, 'password' => $password));
JSONRPC:
$http = new Zend_Http_Client();
$http->setAuth($username, $password);
$client = new Zend_Json_Client($uri, $http);