is it possible to create a custom oAuth server with the Zend Framework Zend_Oauth? For example i want to create a REST service and have oAuth authentication? Does the zend framework have support for this out of the box?>
Currently, there is no working OAuth server/auth adapter. There are a few of us (including myself) working to meld the existing Zend_Oauth into a Zend_Auth_Adapter.
Find me on twitter #onyxraven and we can discuss. I should have an idea of what needs done before the end of the week.
Have you taken a look at http://oauth.net/code/ ?
There is a community contribution:
http://framework.zend.com/svn/framework/standard/incubator/library/Zend/Oauth/Server.php
Related
I want to implement Oauth to protect my PHP Web Services,i have been following this link but found that some of them link are not working.And the working example had implemented in slim,flight some different frameworks in php and i'm newbie in it.My problem is i want to implement Oauth in Codeignter framework to protect Web Service and as per oauth site i've got a link by Alex Bilbie which is deprecated and not working. So if someone had done this before in codeigniter please let me know , Simple PHP would be also fine, later on i can modify it to fit in codeigniter.
I find Brent Shaffer's OAuth2 Server Library for PHP an excellent library!
In the cookbook you can find many examples on how to integrate it into certain frameworks, unfortunately CodeIgniter isn't one of them. But the documentation is very good, and you can use the cookbooks on the other frameworks as a guide for doing it in CodeIgniter.
You can find the library on Github.
I am a newbee to zf and my project requires to integrate hybrid auth social login with zf1.
Unfortunately I could find any hybrid auth for zf1. can anyone please help me for this?
Struggling for this past two days.
Thanks in advance.
In order to do authentication in Zend you should review Zend_Auth documentation to make sure you understand the how things works...
To implement custom authentication in Zend you will have to create your own authentication adapter and pass instance of your adapter to Zend_Auth::authenticate. Implementing a custom adapter is very easy, you only have to implement one interface with one function and define your constructor - see example of custom adapter in Zend documentation and example of how to pass adapter to Zend_Auth instance.
I am not familiar with hybridauth but looks like hybridauth already has bunch of plugins including ZF2. Also, take a look at existing plain PHP hybridauth examples in the repo.
I'm new to Zend Framework (not to PHP), and I need to create a REST based API using Zend.
I've seen examples using Zend_Rest_Server, however other sources state that that has been deprecated.
I'm unable to find a solid example which shows how I should be building such an API.
Zend_Rest_Server is indeed deprecated since ZF 1.9, you should use Zend_Rest_Controller instead. The following blog posts could be helpful : Building RESTful Services with Zend Framework and Create RESTful Applications Using The Zend Framework.
May be this link would be helpful: Creating a PHP REST API Using the Zend Framework.
This code example support REST data in the format of XML and JSON.
Prerequisites:
PHP version > 5
Zend Framework 1.9.2 (at the minimum)
If you want something a little more in details, you can check the book
Zend Framework 2 Application Development.
The book explains construction of API oriented system in ZF2, through examples.
At the end of book you get:
ZF2 API
ZF2 Client side app.
The book has a lot of syntax errors as well as any book for programming,
but it's only one on the market at this moment.
How can I add a Oauth provider to a web application using Zend Framework? Zend Framework has support for oauth consumers, but I don't see a provider support. What do you use to implement a Oauth provider in php (with Zend Framework)?
I followed this guide from Rasmus Lerdorf to implement an OAuth provider.
While I didn't actually use the pecl extension, you can use the article to write your own server component.
If you look at the zend incubator, it has a new Zend_Oauth_Server file
http://framework.zend.com/svn/framework/standard/incubator/library/Zend/Oauth/
I think Brandon's correct in saying that a Provider doesn't exist yet in Zend, but I think this class maybe a future provider they're working on.
We're looking at implementing a provider for one of out projects at work, so I'll probably have to research this in depth soon. Keep me posted if you find more info on this yourself and I'll keep this thread updated on my side.
I'm developing a web app with zend framework and i'd like to discuss what is the best way to intergrate all the JS and FBML in a ZF project, anyone have some experience.
For example, which may be a good solution for have the Facebook istante in every controllers, a front controller plugin?
For all those still landing on this POST: There is a Facebook PHP SDK on github, offered by facebook now.
It is quite helpfull and has a good documentation and examples.
The other Projects listed above are mostly stopped or in alpha status.
Since JS and FBML is part of the presentation layer, these would have to go into ViewHelpers. Fetching data from FB via their APIs would go into a service, like Zend_Service_Facebook. There is a proposal for both components in Ready for Review state for some time now:
http://framework.zend.com/wiki/display/ZFPROP/Zend_Service_Facebook+-+Ian+Warner
http://code.google.com/p/zend-service-facebook/
There's a Zend Framework Library that you can use to access all Facebook Methods at GitHub from your controllers and Models.
https://github.com/erickthered/Facebook-PHP-SDK-for-Zend-Framework
For the views, it's better to add the facebook JS file with the APPID and XFBML parameters to your layout/template so that you can use tags anywhere.
If you are using zend framework 2 you can use this tutorial...
http://kdecom.blogspot.co.nz/2012/10/how-to-login-using-facebook-in-zend.html