Zend Framework 101: Zend_Oauth
In this article I showed you how to use the Zend_Oauth component of the Zend Framework by implementing a basic Twitter client.
I showed you how to authenticate using
Zend_Oauth_Consumer, which consisted of these main steps:
- Retrieve a request token from Twitter
- Store the request token and redirect the user to Twitter
- User authenticates and grants your application permission
- You receive an authorization token and request an access token
- Store the access token, then use for subsequent API calls
Additionally, I showed you some "real world" usage of some other Zend Framework components (such as Zend_Db, Zend_Session and Zend_Service_Twitter).
While this implementation was quite basic (and would need various improvements to scale to fully-featured web application), it hopefully demonstrates how simple and useful a service such as OAuth can be.
- http://framework.zend.com/manual/en/zend.oauth.html - Zend Framework manual entry for Zend_Oauth.
- http://dev.twitter.com/pages/auth - OAuth theory and implementation
- http://dev.twitter.com/pages/sign_in_with_twitter - "Sign in With Twitter" details
- Download a PDF version of this article
- Put your PHP knowledge to the test with our online and iPad/iPhone quizzes
- View or post comments for this article
- Browse similar articles by tag: PHP, Twitter, Zend Framework, Zend_Oauth
- Read related articles: