Zend Framework has pretty good OAuth consumer implementation. However, it has no support for implementing OAuth provider, and it turns out that there aren’t many other libraries for it. Most examples out there base on PECL oauth extension, which works just fine, with one caveat – you have to have this PECL extension installed, while ZF implementation does not require that.
So I went ahead and wrote some code that allows to easily add OAuth provider to your ZF-based or ZF-using application. That should make writing OAuth provider easier.
Note that the code does not implement the whole server – just the OAuth protocol wrapper, you’d still have to do all the work of managing tokens/keys/nonces by yourself. See example server in the repository and the wiki on github for more details on how to do it, but the protocol follows what PECL oauth does pretty closely, so many tutorials for it would be mostly applicable to this one too.
Check out Zend_Oauth_Provider on github, if you want to improve it – please fork and submit pull requests.
Zend Framework has very fantastic OAuth client performance. it has no support for implementing OAuth organization, and it changes out that there are not many other selections for it
Is this OAuth 2.0 or 1.0?
Oauth 1.0.
Do you know where i can get OAuth 2?
Can you write a blog post explaining how to use Zend_Oauth_Provider? Documentation in wiki is quite limited. Hope this will be included in official ZF soon.
Check out Rasmus’ tutorial here: http://toys.lerdorf.com/archives/55-Writing-an-OAuth-Provider-Service.html
It is based on PECL extension, but Zend_Oauth_Provider has similar API. Also, check out example server in the git repo.
Can you provide some documentation for Zend_Oauth_Provider? The link you provided and your example server are not very clear. Thanks.
Can this also be used as a 2 legged oauth provider ?
I do not see why not.
Any chance you’ll propose this for official inclusion in either ZF1 or ZF2? /me pokes…
I thought I already did, some time ago… 🙂 I could write a formal proposal though.
Pingback: PHPDeveloper.org: Stas Malyshev's Blog: ZF Oauth Provider
Nice work ! You might want to try to use php 5.3 namespace and the Zend\Oauth from zf2 repository 🙂
Good work Stas. This was needed for some time. Glad you stepped in.