<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">
<channel>
    <title>Maugrim The Reaper's Blog - Zend Framework</title>
    <link>http://blog.astrumfutura.com/</link>
    <description>Pádraic Brady on PHP, PHP Game Development and More</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.1 - http://www.s9y.org/</generator>
    <pubDate>Tue, 01 Jul 2008 12:15:45 GMT</pubDate>

    <image>
        <url>http://blog.astrumfutura.com/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Maugrim The Reaper's Blog - Zend Framework - Pádraic Brady on PHP, PHP Game Development and More</title>
        <link>http://blog.astrumfutura.com/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Google roll out OAuth Authorisation to all Google Data APIs</title>
    <link>http://blog.astrumfutura.com/archives/385-Google-roll-out-OAuth-Authorisation-to-all-Google-Data-APIs.html</link>
            <category>PHP General</category>
            <category>PHP Security</category>
            <category>Zend Framework</category>
    
    <comments>http://blog.astrumfutura.com/archives/385-Google-roll-out-OAuth-Authorisation-to-all-Google-Data-APIs.html#comments</comments>
    <wfw:comment>http://blog.astrumfutura.com/wfwcomment.php?cid=385</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://blog.astrumfutura.com/rss.php?version=2.0&amp;type=comments&amp;cid=385</wfw:commentRss>
    

    <author>nospam@example.com (Pádraic Brady)</author>
    <content:encoded>
    Last Thursday I saw this turn up on the OAuth mailing list, so I&#039;ve spent a few hours over the weekend adding the final features to the OAuth For PHP library (proposed both to the Zend Framework and PEAR) to ensure it works. Thanks go out to David Koblas for his unprompted assistance to go test the library and uncover the remaining issues!&lt;br /&gt;
&lt;br /&gt;
The actual announcement went out on one of the Google Blogs: &lt;a href=&quot;http://googledataapis.blogspot.com/2008/06/oauth-for-google-data-apis.html&quot;&gt;http://googledataapis.blogspot.com/2008/06/oauth-for-google-data-apis.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;m currently rolling these changes into a new OAuth 0.0.3 release for the PEAR proposal (an arduous task which involves opening the command line and running &quot;phing convert-to-pear&quot; on a subversion export of the ZF base code &lt;img src=&quot;http://blog.astrumfutura.com/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;). Once that hits the proposal I&#039;ll switch into voting mode and see what comments the always insightful PEAR developers drop on top of me. Of course this means the changes are already in the matching Zend Framework Proposal respository at &lt;a href=&quot;http://svn.astrumfutura.org/zendframework/trunk&quot;&gt;http://svn.astrumfutura.org/zendframework/trunk&lt;/a&gt; along with examples of its usage with the Ma.gnolia API and the Google Data APIs waiting for its future Zend review.&lt;br /&gt;
&lt;br /&gt;
The OAuth Consumer is now hitting the point where I&#039;d rate it as beta. Most of the absolutely neccessary features are finished, and could likely only do with a touch of the refactoring brush. The last major feature is implementing a backend storage solution for OAuth tokens.&lt;br /&gt;
&lt;br /&gt;
The Google Data API support comes with a few gotchas. Its documentation show a clear preference for using GET instead of POST, though the Google OAuth server does appear to natively support POST requests for everything with the exception that it has a small bug which interprets an empty POST request body as a sort of phantom empty parameter which messes up the validation of a Client&#039;s RSA-SHA1 signature. Other then that it&#039;s ready to go. Might be time to add comments to my code...&lt;img src=&quot;http://blog.astrumfutura.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;. The bug has been reported but it&#039;s still preferable to stick with GET requests unless the Google OAuth documentation ever specifies it as an option.&lt;br /&gt;
&lt;br /&gt;
If all goes well, the dual proposal process across PEAR and the Zend Framework should make for a another good OAuth library in PHP. Next up in the near future when an OAuth Server is also implemented will be adding support for some common OAuth Extensions - talk of these is already accelerating on the mailing lists as discussions turn to the next iteration of the OAuth Core Specification which has taken on the name OAuth Core 2008.1 (a sort of dual date + revision number system).&lt;br /&gt;
&lt;br /&gt;
For those watching the PEAR proposal, I&#039;ll roll out OAuth 0.0.3 to the proposal during tomorrow. The last two have been unstable at best while on the drawing board so this near-stable one should be a stark contrast since it works without any hitches.  
    </content:encoded>
    <dc:creator>P&#225;draic Brady</dc:creator>

    <pubDate>Mon, 30 Jun 2008 21:24:43 +0000</pubDate>
    <guid isPermaLink="false">http://blog.astrumfutura.com/archives/385-guid.html</guid>
    <category>oauth</category>
<category>pear</category>
<category>php</category>
<category>php general</category>
<category>php security</category>
<category>zend framework</category>
<category>zf proposal</category>
<creativeCommons:license>http://creativecommons.org/licenses/by/1.0/</creativeCommons:license>
</item>
<item>
    <title>OAuth For PHP Status Update...</title>
    <link>http://blog.astrumfutura.com/archives/383-OAuth-For-PHP-Status-Update....html</link>
            <category>PHP General</category>
            <category>PHP Security</category>
            <category>Zend Framework</category>
    
    <comments>http://blog.astrumfutura.com/archives/383-OAuth-For-PHP-Status-Update....html#comments</comments>
    <wfw:comment>http://blog.astrumfutura.com/wfwcomment.php?cid=383</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.astrumfutura.com/rss.php?version=2.0&amp;type=comments&amp;cid=383</wfw:commentRss>
    

    <author>nospam@example.com (Pádraic Brady)</author>
    <content:encoded>
    Edit: Firefox 3 appeared to have auto filled in a password option on this entry previously - my apologies and here&#039;s the full entry!&lt;br /&gt;
&lt;br /&gt;
Earlier today I finished up work on the initial OAuth library. It has a few rough edges and missing features, but the bulk of the work for an OAuth Consumer is there. The rest is refactoring, feature iteration, and testing.&lt;br /&gt;
&lt;br /&gt;
The new library is specifically targeted as a dual-proposal. It has been proposed to both PEAR and the Zend Framework. Rather than maintaining two distinct versions, or one distinct version with a heavy dose of abstraction, both are derived from the Zend Framework version. In essence, I develop primarily on the Zend Framework version, iterate patches onto a simple Phing task-chain, and out comes the PEAR version. This extends itself into the test suite too. This allows me to use the same base code, with changes appropriate to the underlying system (e.g. using PEAR HTTP_Request instead of ZF Zend_Http_Request).&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://framework.zend.com/wiki/pages/viewpage.action?pageId=37957&quot;&gt;The Zend Framework Proposal&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://pear.php.net/pepr/pepr-proposal-show.php?id=512&quot;&gt;The PEAR Proposal&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Comments to both are more than welcome. For anyone wishing to ask questions outside of these proposal processes, I have also established a mailing list on Google Groups for the &quot;OAuth For PHP&quot; project: &lt;a href=&quot;http://groups.google.com/group/oauth-for-php&quot;&gt;http://groups.google.com/group/oauth-for-php&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Over the weekend I posted a quick example of using the Zend_Oauth component to retrieve data from Ma.gnolia&#039;s API, a similar example using the PEAR code is available at &lt;a href=&quot;http://code.google.com/p/oauth-for-php/source/browse/trunk/docs/examples/magnolia.php&quot;&gt;PEAR OAuth Ma.gnolia Example&lt;/a&gt;. If nothing else it highlights what remains to be done. Don&#039;t get me wrong - you could almost use the current code, but there is a lot of support that can be added to make use easier.&lt;br /&gt;
&lt;br /&gt;
So what is remaining?&lt;br /&gt;
&lt;br /&gt;
The initial library remained tightly focused on implementing OAuth across HTTP POST. Obviously this means GET is left languishing by the wayside for now. One of the reasons was simply that a narrow focus also has the benefit of simplifying testing. And what works with POST URL query strings, should apply similarly to GET requests.&lt;br /&gt;
&lt;br /&gt;
Secondly, there is absolutely no backend storage medium available as yet. In the examples, I temporarily stored all tokens to the Session. Ideally I will implement both a File and DB based storage backend this week.&lt;br /&gt;
&lt;br /&gt;
Thirdly, the workflow of an actual Web Service API interaction is externalised. There is no way to get the OAuth library to handle requests to web services internally, using a specialised OAuth client, automatically making authorised POST/GET requests with the relevant data. Rather you can extract the OAuth authorisation parameters as a Header or Query String value for use in any HTTP client you wish (perhaps not perfectly ideal but the flexibility won&#039;t tie you to any particular client implementation either &lt;img src=&quot;http://blog.astrumfutura.com/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;).&lt;br /&gt;
&lt;br /&gt;
Fourthly, support for RSA signing is omitted. Technically there is a problem supporting PHP&#039;s openssl extension on two fronts. The first is that PEAR&#039;s Crypt_RSA is a slower native implementation of RSA which doesn&#039;t optionally offload work on ext/openssl. The second is that ext/openssl itself is a tricky extension - it&#039;s API is badly documented (one of the worst), and it tends to have BC issues across different PHP versions. &lt;br /&gt;
&lt;br /&gt;
Lastly, there is no OAuth Server just yet! A Server is next on my agenda though, so expect it to commence development almost immediately.&lt;br /&gt;
&lt;br /&gt;
The end goal however, is substantially closer than it was last week! We have code, tests and a working example. The community feedback channel is now open.  
    </content:encoded>
    <dc:creator>P&#225;draic Brady</dc:creator>

    <pubDate>Wed, 25 Jun 2008 00:21:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.astrumfutura.com/archives/383-guid.html</guid>
    <category>maugrim</category>
<category>oauth</category>
<category>pear</category>
<category>php</category>
<category>php general</category>
<category>php security</category>
<category>yadis</category>
<category>zend framework</category>
<category>zf proposal</category>
<creativeCommons:license>http://creativecommons.org/licenses/by/1.0/</creativeCommons:license>
</item>
<item>
    <title>Another OAuth Library Is Born</title>
    <link>http://blog.astrumfutura.com/archives/382-Another-OAuth-Library-Is-Born.html</link>
            <category>Openid and Yadis</category>
            <category>PHP General</category>
            <category>PHP Security</category>
            <category>Zend Framework</category>
    
    <comments>http://blog.astrumfutura.com/archives/382-Another-OAuth-Library-Is-Born.html#comments</comments>
    <wfw:comment>http://blog.astrumfutura.com/wfwcomment.php?cid=382</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.astrumfutura.com/rss.php?version=2.0&amp;type=comments&amp;cid=382</wfw:commentRss>
    

    <author>nospam@example.com (Pádraic Brady)</author>
    <content:encoded>
    I&#039;ve spent some time over the last week, and I have completed an initial pass at writing an OAuth Consumer in PHP5. I&#039;m biased, but it&#039;s a nice chunk of code capable of fairly routine POST based OAuth requests using either an Authorized header, or a raw url encoded POST request body. My main remaining task is final cleanup, included refactoring, rolling my final set of acceptance tests into PHPUnit from SimpleTest, and adding support for HTTP GET, RSA, and a storage API so tokens can be saved in the background rather than outside the API.&lt;br /&gt;
&lt;br /&gt;
I wrote up a quick example script using the current source code - bear in mind the final API will be tweaked but this is a close match for what I&#039;d expect to become final (I&#039;ll await community feedback before finalising anything!).&lt;br /&gt;
&lt;br /&gt;
You can grab the code, which is geared up for integration into the Zend Framework as a Zend_Oauth component, from my proposals repository at &lt;a href=&quot;http://svn.astrumfutura.org/zendframework/trunk/&quot;&gt;http://svn.astrumfutura.org/zendframework/trunk/&lt;/a&gt; (proposed components are in /trunk/library/Proposed). I fully expect to refactor a similar core library specifically for use with PEAR in the very near future.&lt;br /&gt;
&lt;br /&gt;
Onwards with the example! I&#039;m using the &lt;a href=&quot;http://ma.gnolia.com&quot;&gt;Ma.gnolia bookmarking service&#039;s&lt;/a&gt; API (version 2) here. If you intend actually running the example, you will need to create a Ma.gnolia account and visit &lt;a href=&quot;http://ma.gnolia.com/applications/new&quot;&gt;http://ma.gnolia.com/applications/new&lt;/a&gt; to register an application to get hold of an OAuth Consumer Key. Registering an application is a bit confusing - but basically create an imaginary one (e.g. &quot;Super Duper OAuth Test Application&quot;. Since you&#039;ll be the only user for now, you can use it across any OAuth testing regardless of application name. In the code, replace CONSUMER_KEY and CONSUMER_KEY_SECRET strings with the real thing.&lt;br /&gt;
&lt;br /&gt;
The example isn&#039;t explained here - if you&#039;re unfamiliar with OAuth I&#039;ll explain it better in the future when this is all closer to completion. For now refer to the &lt;a href=&quot;http://oauth.net/core/1.0/&quot;&gt;OAuth Core 1.0 Specification&lt;/a&gt; (the starting sections are pretty good at explaining things). The amount of code is indicative of features being wrapped around the existing API as they are not yet integrated directly (e.g. using Sessions to store temporary tokens instead of an internally referenced database). Also note that the example creates a new Access Key every single request (generally the annoyance of authorising yourself every time doesn&#039;t exist in a completed solution &lt;img src=&quot;http://blog.astrumfutura.com/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;).&lt;br /&gt;
&lt;br /&gt;
What does the example do? Simply checks how many bookmarks members of the OAuth Ma.gnolia Group have saved. Think it was 126 or so. The printed response is XML.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/session_start&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;session_start&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;require_once&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Zend/Oauth/Consumer.php&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$options&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;requestScheme&#039;&lt;/span&gt; =&amp;gt; Zend_Oauth::&lt;span style=&quot;color: #006600;&quot;&gt;REQUEST_SCHEME_HEADER&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;version&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;1.0&#039;&lt;/span&gt;, &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// there is only a 1.0 version for now &amp;lt;img src=&amp;quot;/templates/default/img/emoticons/wink.png&amp;quot; alt=&amp;quot;;-)&amp;quot; style=&amp;quot;display: inline; vertical-align: bottom;&amp;quot; class=&amp;quot;emoticon&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;signatureMethod&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;HMAC-SHA1&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;localUrl&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;http://path/to/this/file.php&#039;&lt;/span&gt;, &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// change to this file&#039;s local URL&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;requestTokenUrl&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;http://ma.gnolia.com/oauth/get_request_token&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;userAuthorisationUrl&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;http://ma.gnolia.com/oauth/authorize&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;accessTokenUrl&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;http://ma.gnolia.com/oauth/get_access_token&#039;&lt;/span&gt;,&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// replace with your own real application consumer key and key secret!&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$consumer&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Zend_Oauth_Consumer&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;CONSUMER_KEY&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;CONSUMER_KEY_SECRET&#039;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$options&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;ACCESS_TOKEN&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;a href=&quot;http://www.php.net/empty&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_GET&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$token&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$consumer&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getAccessToken&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_GET&lt;/span&gt;, &lt;a href=&quot;http://www.php.net/unserialize&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;unserialize&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;REQUEST_TOKEN&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;ACCESS_TOKEN&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/serialize&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;serialize&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$token&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$token&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$consumer&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getRequestToken&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;REQUEST_TOKEN&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/serialize&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;serialize&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$token&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$consumer&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;redirect&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$token&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/unserialize&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;unserialize&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;ACCESS_TOKEN&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;ACCESS_TOKEN&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$methodUrl&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;http://ma.gnolia.com/api/rest/2/bookmarks_count&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$rawData&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$token&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;toQueryString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$methodUrl&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$consumer&lt;/span&gt;, &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;group&#039;&lt;/span&gt;=&amp;gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;oauth&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$client&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Zend_Http_Client;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$client&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setUri&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$methodUrl&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$client&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setMethod&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Zend_Http_Client::&lt;span style=&quot;color: #006600;&quot;&gt;POST&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$client&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setRawData&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$rawData&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$response&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$client&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/header&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;header&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Content-Type: &#039;&lt;/span&gt; . &lt;span style=&quot;color: #0000ff;&quot;&gt;$response&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getHeader&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Content-Type&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$response&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getBody&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
You can comment on the formal Zend Framework proposal for a Zend_Oauth at &lt;a href=&quot;http://framework.zend.com/wiki/pages/viewpage.action?pageId=37957&quot;&gt;http://framework.zend.com/wiki/pages/viewpage.action?pageId=37957&lt;/a&gt;.  
    </content:encoded>
    <dc:creator>P&#225;draic Brady</dc:creator>

    <pubDate>Sat, 21 Jun 2008 20:40:56 +0000</pubDate>
    <guid isPermaLink="false">http://blog.astrumfutura.com/archives/382-guid.html</guid>
    <category>oauth</category>
<category>openid</category>
<category>openid and yadis</category>
<category>pear</category>
<category>php</category>
<category>php general</category>
<category>php security</category>
<category>zend framework</category>
<category>zf proposal</category>
<creativeCommons:license>http://creativecommons.org/licenses/by/1.0/</creativeCommons:license>
</item>
<item>
    <title>Services_Oauth and Zend_Oauth Revisited</title>
    <link>http://blog.astrumfutura.com/archives/381-Services_Oauth-and-Zend_Oauth-Revisited.html</link>
            <category>Openid and Yadis</category>
            <category>PHP General</category>
            <category>PHP Security</category>
            <category>Zend Framework</category>
    
    <comments>http://blog.astrumfutura.com/archives/381-Services_Oauth-and-Zend_Oauth-Revisited.html#comments</comments>
    <wfw:comment>http://blog.astrumfutura.com/wfwcomment.php?cid=381</wfw:comment>

    <slash:comments>6</slash:comments>
    <wfw:commentRss>http://blog.astrumfutura.com/rss.php?version=2.0&amp;type=comments&amp;cid=381</wfw:commentRss>
    

    <author>nospam@example.com (Pádraic Brady)</author>
    <content:encoded>
    With my cryptographic efforts exhausted (I&#039;ll wait for the weekend to figure out the intricacies of ext/openssl API changes across 15+ PHP versions), my attention has wandered back to OAuth.&lt;br /&gt;
&lt;br /&gt;
What is OAuth? &quot;An open protocol to allow secure API authentication in a simple and standard method from desktop and web applications&quot; - &lt;a href=&quot;http://oauth.net/&quot;&gt;http://oauth.net/&lt;/a&gt;. If you&#039;re not yet up to speed it&#039;s being adopted by both Yahoo and Google. Interested now? &lt;img src=&quot;http://blog.astrumfutura.com/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Starting yesterday, I opened up my IDE, updated PHPUnit, and got cracking. At the current rate of development a Consumer is likely at the weekend. I&#039;ve already started writing up a formal proposal for PEAR and, of course, the Zend Framework also. I&#039;m thankful the OAuth specification is this simple - it&#039;s one of the easiest to read specifications I&#039;ve had to pleasure to work with. The cost of that is a certain level of vagueness on some points, but nothing you can&#039;t overcome with a little reading of the OAuth mailing list.&lt;br /&gt;
&lt;br /&gt;
Of course with any new Specification, there comes potential implementation trouble hard on its heels. Talk about an OAuth Core 1.1 Specification is well underway on the mailing list which drags up concerns over the future compatibility of an early API based on 1.0. I&#039;m not too worried here since these types of APIs are often extremely simple and flexible, very much belying the enormous work and mountain of source code existing in the background.&lt;br /&gt;
&lt;br /&gt;
The other concern are Extensions. OAuth 1.0 allows for Extensions, of which there are several Drafts already. One of the more interesting Extensions is OAuth Discovery 1.0 which will create a dependency (when implemented) on Zend_Service_Yadis (for the Yadis 1.0 Protocol). This Extension will be more formally integrated into OAuth Core 1.1 so it&#039;s optional only if you ignore it hard enough! The Yadis component is one of those semi-lost proposals - it&#039;s now hitting 15 months on the Zend Review list waiting for finalisation and comment (it has been released on PEAR as beta already).&lt;br /&gt;
&lt;br /&gt;
The other reason this is a bit distracting is that a 15 month old proposal inevitably misses 15 months of clarifications, developments and the rapidly shifting sands of the specification community. For example, Yadis 1.0 Specification is making the move into the upcoming OASIS XRI Resolution 2.0 Specification (Section 6) and there is a new OAuth driven XRDS-Simple 1.0 Specification Draft. These all accumulate unless you regularly assess them all and make incremental changes.&lt;br /&gt;
&lt;br /&gt;
I&#039;ve had people beating the bushes trying to to flush me out into the open so they can request I get this started. They&#039;ll be happy to hear it&#039;s now in progress.&lt;br /&gt;
&lt;br /&gt;
Edit: A few people were curious about why OAuth is worth paying attention to. The simplest convincing answer is to point out the alternative. Say you use GMail and a website asks you to import your contact data - how does it access that data?&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.codinghorror.com/blog/images/yelp-friends-check-fail.png&quot; width=&quot;95%&quot; alt=&quot;Oooh! Let&#039;s get everyones secret password to GMail! ;)&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Do you want every Tom, Dick and Harry website to potentially store your GMail email address and password for some future nefarious purpose? Yet people put their absolute trust in this model day after day on social networking sites.&lt;br /&gt;
&lt;br /&gt;
Do yourself a favour - if you&#039;re a developer writing an API make it possible for web sites to access your users&#039; data without having to beg them for their username and so-called secret private password.  
    </content:encoded>
    <dc:creator>P&#225;draic Brady</dc:creator>

    <pubDate>Wed, 18 Jun 2008 11:48:25 +0000</pubDate>
    <guid isPermaLink="false">http://blog.astrumfutura.com/archives/381-guid.html</guid>
    <category>oauth</category>
<category>openid</category>
<category>openid and yadis</category>
<category>pear</category>
<category>php general</category>
<category>php security</category>
<category>xri</category>
<category>yadis</category>
<category>zend framework</category>
<creativeCommons:license>http://creativecommons.org/licenses/by/1.0/</creativeCommons:license>
</item>

</channel>
</rss>