1

I currently have a web application built using a custom MVC framework with a front controller. The frame provides for things like authentication, authorization etc.

The flow is currently as follows request->authenticate->check authorization->process request

I would like to add Zend_AMF into the mix so that a different front end built in flash may be used. Looking at the Zend_AMF documentation, I can see that Zend_AMF supports authentication (Zend_Auth) and authorization (Zend_ACL). The issue is that I would like to use my own authentication and authorization classes in my framework. I do not wish to use Zend_ACL and Zend_Auth.

My idea is to then implement the Zend_AMF server as a controller. I then need to intercept the request from Zend_AMF, determine whether the user is allowed to run that method, generate the response and then hand it back to Zend_AMF to send back.

The problem is that how do I intercept the request, do my processing and then hand it back to Zend_AMF? I have been looking at the documentation, but cant seem to find a way to do this.

Any ideas or even better solutions are very welcomed :)

F21
  • 32,163
  • 26
  • 99
  • 170
  • 1
    Can you not just implement the ACL interfaces and write a Zend_Auth compatible adapater that bridges to your internal classes? This might be easier than subclassing or wrapping Zend_Amf itself. – prodigitalson Jun 28 '11 at 01:13
  • That might be a possibility. However, Zend_ACL does not have interfaces I can extend (from my quick look at the api docs). – F21 Jun 28 '11 at 08:01
  • There should be interfaces for Role, Assert, and Resource. – prodigitalson Jun 28 '11 at 15:12
  • 1
    You might want to look at [AMFPHP](http://projects.silexlabs.org/?/amfphp#/php.remoting/what.is.amfphp).It's a much simpler library to do AMF remoting. Zend adds a lot of extras, this is more about just straight up flash communication. – J_A_X Jun 28 '11 at 15:15
  • I am looking at AMFPHP at the moment. The only downside is that they've only started development after a long haitus and 2.0 is still in alpha. Something like SabreAMF would be awesome, as I can define my own callback function to handle the processing. There is however, a function called "addFunction" in Zend_AMF. I have tried using it, but it doesn't seem to call my function. Can't find any info on it, and the example that mentioned it says it is a callback function, but doesn't elaborate. – F21 Jun 29 '11 at 06:40

0 Answers0