PHP 10.0 Blog

What if…

ZF Oauth Provider

Posted by Stas on August 28, 2011

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.


About these ads

14 Responses to “ZF Oauth Provider”

  1. Good work Stas. This was needed for some time. Glad you stepped in.

  2. Smith said

    Nice work ! You might want to try to use php 5.3 namespace and the Zend\Oauth from zf2 repository :)

  3. [...] a new post Stas Malyshev has shared some code for an OAuth provider he's written up to work specifically with Zend Framework applications. Zend Framework has pretty [...]

  4. Any chance you’ll propose this for official inclusion in either ZF1 or ZF2? /me pokes…

  5. Jan said

    Can this also be used as a 2 legged oauth provider ?

  6. Warren said

    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.

  7. James said

    Is this OAuth 2.0 or 1.0?

  8. Elmo Frost said

    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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: