Authentication methods for Zend Framework XML-RPC server

I have a Zend Framework application whose sole purpose is to serve as an XmlRpc / JSONRPC server.

I've mostly followed the philosophy from this guide for my implementation method. I overrode my Bootstrap's run() method to run a Zend_XmlRpc_Server object and attach the API classes to it.

I want to authenticate any XML-RPC method that gets ran with an "API key" I have stored in a database table. If I had a traditional MVC ZF setup, I would use a controller plugin to automatically take care of the authentication, but I don't have that option. My only solution right now is manually insert code into each API method to check for authentication.

Any thoughts on a more pragmatic way to solve this issue? I'd prefer not to have a bunch of repeated code at the top of every method.

-------------Problems Reply------------

several ways to solve the q

  1. easiest create in Bootstrap Reqest Object manually and check headers

    protected function _initModifiedFrontController()
    {
    $this->bootstrap('FrontController');
    $front = $this->getResource('FrontController');

    $request = new Zend_Controller_Request_Http();

    $response = new Zend_Controller_Response_Http();
    $response->setHeader('Content-Type','text/html; charset=UTF-8', true);
    $front->setResponse($response);
    $front->setRequest($request);

    if ($request->isXmlHttpRequest()) {
    $authAdapter = new Zend_Auth_Adapter_DbTable(
    $dbAdapter,
    'users',
    'username',
    'password'
    );

    // ...or configure the instance with setter methods
    $authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter);

    $authAdapter
    ->setTableName('users')
    ->setIdentityColumn('username')
    ->setCredentialColumn('password')
    ;

    }

    }

Read manual Zend_Auth. this is a "zend way".

or u can write custom AuthAdaper.it's easy :)

UPDATE 1:

Read this carefully

Category:php Views:0 Time:2009-12-21

Related post

  • Zend Framework XML-RPC? 2010-08-18

    I would like to build an XML over HTTP provisioning interface using Zend Framework. Should Zend_XmlRpc_Server be used for this purpose? If so, can you recommend any guides on using it? (Specifically the part retrieving incoming XML and parsing it.) -

  • Hooking Up an NSTableView to an XML-RPC Server 2008-11-19

    There are multiple ways to fill an NSTableView up with data through either bindings, delegates, or data sources. What is the best way to go about filling up the tableview with data that is changed pretty frequently from an XML-RPC server? I'm targeti

  • Python XML-RPC server as a Windows service 2011-12-07

    I'm trying to create an XML-RPC server as a windows service. The XML-RPC server is able to get and put files (like FTP) and also execute commands via os.system() that the remote client sends to it. I'm trying the encapsulate the server in the windows

  • Help with XML-RPC server 2008-11-17

    I'm now trying to create a xml-rpc server with the CodeIgniter Framework. <?php $this->load->library('xmlrpc'); $this->load->library('xmlrpcs'); $config['functions']['weblogUpdates.ping'] = array('function' => 'weblogUpdates.ping');

  • Zend Framework and SQL Server 2009-03-11

    I'm trying to use Zend Framework with SQL server 2005 express (through Pdo_Mssql with wamp installation) but seem that pdo can't connect to SQL. This is my code: require '../application/bootstrap.php'; try { $db = Zend_Db::factory('Pdo_Mssql', array(

  • How to implement an XML-RPC server in AS3 (Flash or AIR runtime)? 2009-08-26

    I'm looking for a good XML-RPC server implementation to be included as part of an existing Flash+AS3 application in order to be notified on events by a client. The ideal implementation should be well written, documented, reliable and encapsulated in

  • How to find out if an XML-RPC server is working? 2010-03-08

    I have a huge Ping list and want to clean it. Using PHP I have already removed duplicated, checked for 404s, redirects etc. I was wondering what I could send to the URLs to see if they are actually functioning and open for submissions? --------------

  • XML-RPC server logging 2011-03-27

    I found a recipe do log activities of an XML-RPC server at http://code.activestate.com/recipes/496700-logging-simplexmlrpcserver/ The problem that I'm having is I want to reuse the LoggingSimpleRPCRequestHandler (i.e import it) but I don't know how t

  • Installing Zend framework with WAMP server 2009-03-31

    I'm trying to install Zend framework on a WAMP server but it is not working properly. I downloaded the Zend framework and created the folder in C:\wamp\library\Zend, and then in php.inc I have something like this: ; Windows: "\path1;\path2" ;include_

  • Need a HTTPS-capable Python XML-RPC server 2009-10-01

    I already have a very simple threading XML-RPC server in Python: from SocketServer import ThreadingMixIn class AsyncXMLRPCServer(ThreadingMixIn, SimpleXMLRPCServer): pass server = AsyncXMLRPCServer(('localhost', 9999)) server.register_instance(some_o

  • XML-RPC Server in Cocoa 2010-10-11

    I need to create an XML-RPC server on the iphone for testing purposes. Is there is a library I could leverage? --------------Solutions------------- Check out eczarny / xmlrpc on github. It comes with a test server. Writing such a server -- especially

  • XML-RPC server in EJB module 2011-01-31

    I'm wondering if it is possible to create XML-RPC server component within EJB module without servlets. I know EJB typically uses RMI as communication protocol but what if I want to omit RMI. What if i want to exchange data between EJB and web module

  • Creating a logical connection and calling procedures on a XML-RPC server which verifies CSRF tokens - python xmlrpclib 2011-02-10

    I am using xmlrpclib in python to connect to a xml-rpc server that verifies csrf tokens. proxy = ServerProxy("http://127.0.0.1:9091/transmission/rpc/") proxy.system.listMethods() I am getting the following exception ProtocolError: <ProtocolError f

  • Subquery Method in Zend Framework, Possible? 2011-07-27

    I was just wondering if there is a method in Zend Framework I could use to add subqueries. I believe I have already seen one but not sure at the moment for it has been 2 years since I've worked on a project using the framework. I'm more into Codeigni

  • Request and response Queue in Apache XML RPC server 2012-02-04

    i developed a XML RPC server by using Apache XMLRPC API , RPC Server takes client request to perform some operations on other servers, and send back response to client , RPC server have some connections to other server which are non serialize and not

  • Xml-RPC Server Python - Multicall requests? 2013-06-16

    Let's assume that my code looks like that: from SimpleXMLRPCServer import SimpleXMLRPCServer from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler # Restrict to a particular path. class RequestHandler(SimpleXMLRPCRequestHandler): rpc_paths = ('/R

  • Best method of Zend Framework caching 2010-06-15

    I have a blog built using Zend Framework, which I realize might be a bit overkill for a blog alone, but I am planning on adding other features in the future. Nevertheless, I've noticed pages could be a little speedier. I've done a basic caching metho

  • Zend Framework and SQL Server database 2010-07-22

    Is it possible to take advantage of SQL Server in Zend Framework? I tried run my zend server with pdo_mssql, sqlserver and odbc and failed each time. Did you manage to use SQL Server in your project? Kind Regards, --------------Solutions-------------

  • Determining version of zend framework installed on server 2010-07-29

    Is there a way to determe what version of zend framework is installed on a server/included in the app? The reason I'm asking is that I'm on a shared host and I would like to use a different version than that supplied by the host and I would like to b

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.156 (s). 11 q(s)