<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>andrewmccall.com &#187; open source</title>
	<atom:link href="http://andrewmccall.com/category/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewmccall.com</link>
	<description>If you want to know what I think...</description>
	<lastBuildDate>Wed, 02 Jun 2010 20:24:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>OAuth 2.0</title>
		<link>http://andrewmccall.com/2010/05/oauth-2-0/</link>
		<comments>http://andrewmccall.com/2010/05/oauth-2-0/#comments</comments>
		<pubDate>Thu, 20 May 2010 08:27:10 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://andrewmccall.com/?p=525</guid>
		<description><![CDATA[I&#8217;ve been updating my OAuth library to support OAuth 2.0 mostly so I can add Facebook to Announce.ly and Sproozi, ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been updating my OAuth library to support OAuth 2.0 mostly so I can add Facebook to Announce.ly and Sproozi, but more on that later. OAuth 2.0 is similar to 1.0 but changes a few key things fundamentally and isn&#8217;t backwards compatible.</p>
<p><strong>What&#8217;s wrong with 1.0, doesn&#8217;t it work?</strong></p>
<p>It does, but probably the biggest issue is the fact that you have to sign the message knowing all it&#8217;s content beforehand. This works well if the data is on the querystring in a GET request or for simple operations but isn&#8217;t optimal if your data is part of the POST body. It also means you have to construct your requests in a certain way, which is a bad thing.</p>
<p>Take photo, audio or video data &#8211; to post that you&#8217;ll need to sign the whole request and it&#8217;s not clear how it should work with multipart data. There are several extensions to the spec that deal with some of these issues, but the fact that there are non standard extensions to do something pretty standard kinda says it all.</p>
<p>Even if you&#8217;re not dealing with these issues you still have to work with your requests as units where you know the whole content beforehand.</p>
<p><strong>What&#8217;s new in OAuth 2?</strong></p>
<p>OAuth 2.0 in it&#8217;s simplest form works over HTTPS connections and simply asks for a token &#8211; the security and trust are built in to the protocol. It&#8217;s that easy.</p>
<p>OAuth 2.0 sill lets users sign messages to transmit them over insecure channels, plain HTTP, but the signing methods are much easier to implement. Gone is the complicated parameter normalisation algorithm and in it&#8217;s place is a much simpler version that doesn&#8217;t require POST data in the signature. So even with multipart submissions it should just work.</p>
<p>At the moment I&#8217;m cleaning things up and preparing the oauth library to work with oauth 2.0 and changing the way it works to reflect the simpler way oauth 2.0 does. You can check it out on GitHub [<a href="http://github.com/andrewmccall/oauth">http://github.com/andrewmccall/oauth</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmccall.com/2010/05/oauth-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another Open Source Library.</title>
		<link>http://andrewmccall.com/2010/04/another-open-source-library/</link>
		<comments>http://andrewmccall.com/2010/04/another-open-source-library/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 23:38:03 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[accounts]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[announce.ly]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[hbase]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[sproozi]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://andrewmccall.com/?p=518</guid>
		<description><![CDATA[I&#8217;m having a bit of a clear out, taking a look at some of the code I&#8217;ve written and I&#8217;ve ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m having a bit of a clear out, taking a look at some of the code I&#8217;ve written and I&#8217;ve been pushing some of the stuff I&#8217;m currently using up to <a href="http://github.com/andrewmccall">GitHub</a> under and Apache 2 licence. I&#8217;ve used things in <a href="http://announce.ly">Announce.ly</a>, <a href="http://sproozi.com">Sproozi</a> and some other small projects and figure they may be useful to someone else. My only criteria has been to ask If I&#8217;m using it now in a project, if so I&#8217;m actively supporting it and I&#8217;ve started pushing that stuff to <a href="http://github.com/andrewmccall">GitHub</a>, everything else is dormant and I don&#8217;t want to release something I&#8217;m not actively supporting- it also occurs to me that if even I&#8217;m not using it, it can&#8217;t be all that worthwhile.</p>
<p>I&#8217;ve just pushed <a href="http://github.com/andrewmccall/accounts">some code </a>I&#8217;ve been testing for a few months in a couple of projects to <a href="http://github.com/andrewmccall">GitHub</a>. It&#8217;s an accounts package written for <a href="http://springframework.org">Spring</a>, that ties my <a href="http://github.com/andrewmccall/oauth">oAuth</a> library and <a href="http://twitter.com">Twitter</a> together with either <a href="http://hibernate.org">Hibernate</a> or <a href="http://hadoop.apache.org/hbase">Hbase</a> as backend storage. In it&#8217;s simplest form when you login with twitter it creates you a new user and persists it and the oAuth access tokens you need to act on behalf of that user.</p>
<p>I&#8217;ll write some more about it, better documentation and probably throw a little more code up on <a href="http://github.com/andrewmccall">GitHub</a> over the course of the next couple of weeks as and when I get a chance.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmccall.com/2010/04/another-open-source-library/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My new open source Java OAuth library</title>
		<link>http://andrewmccall.com/2010/03/my-new-open-source-java-oauth-library/</link>
		<comments>http://andrewmccall.com/2010/03/my-new-open-source-java-oauth-library/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 22:40:17 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://andrewmccall.com/?p=504</guid>
		<description><![CDATA[I&#8217;ve just pushed out a new open source java OAuth library because I couldn&#8217;t find one that did what I ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just pushed out a new open source java OAuth library because I couldn&#8217;t find one that did what I needed. My key requirement was simplicity. I didn&#8217;t like the idea of using the library for HTTP stuff and there is no reason I should. Once I&#8217;ve obtained the Access Token all I&#8217;m doing with oAuth is signing my requests.</p>
<p>I want to use HttpClient directly and only use the oAuth library to sign the message for various reasons not the least of which being that I already have a HttpClient object setup in my IoC container.</p>
<p>The closest I found was <a href=" http://github.com/kaeppler/signpost">signpost</a> but it wasn&#8217;t very IoC friendly or thread-safe which meant every time I wanted to make a call I&#8217;d have to create new objects, or at the very least call a bunch of methods to set them up which highlights the third problem, there were no clear objects that I could store for later.</p>
<p>The library I&#8217;ve just release is a fork of the signpost code, that&#8217;s now thread-safe and should be more IoC friendly. You create your method calls as you would normally, and just before you call <code>HttpClient.execute(HttpMethod)</code> simply call <code>OAuthConsumer.sign(HttpMethod, AccessToken);</code>.</p>
<p>I&#8217;ve added a few new objects that handle most of the work. Service, RequestToken and AccessToken are all beans that you pass to a consumer depending on what you want to do. Starting with a Service you call</p>
<pre class="brush: java">
Service service = new Service();
service.setRequestTokenUrl("http://twitter.com/oauth/request_token");
service.setAccessTokenUrl("http://twitter.com/oauth/access_token");

service.setConsumerKey("b8sA385mBBNqOTD6Omlsw");
service.setSharedSecret("MD4Sve6AdaDasjdvOAsbpAJsA87S8s64e5rE4");

service.setMessageSigner(new PlainTextMessageSigner());
service.setSigningStrategy(new AuthorizationHeaderSigningStrategy());

RequestToken requestToken = oAuthConsumer.getRequestToken(twitter);
</pre>
<p>You&#8217;ll have to send the user off to twitter to check their credentials. When they come back<br />
they&#8217;ll be given a verifier set it and trade the request token for an access token</p>
<pre class="brush: java">
requestToken.setVerifier(verifier):
AccessToken accessToken = oAuthConsumer.getAccessToken(requestToken);
</pre>
<p>Now you can store the accessToken to use later, when you want to simply setup your http method as you would normally.   </p>
<pre class="brush: java">
HttpUriRequest request...
// do your HttpClient stuff here

oAuthConsumer.sign(request, accessToken);
HttpResponse response = httpClient.execute(request);
</pre>
<p>There is also code in there for the Jetty HttpClient, but it&#8217;s a bit rough and I haven&#8217;t used it. Have  play with it and let me know what you think. </p>
<p>UPDATE: Forgot to link to it&#8230; Dumb. <a href="http://github.com/andrewmccall/oauth">It&#8217;s on GitHub here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmccall.com/2010/03/my-new-open-source-java-oauth-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Downloading maven dependency source jars</title>
		<link>http://andrewmccall.com/2009/11/downloading-maven-dependency-source-jars/</link>
		<comments>http://andrewmccall.com/2009/11/downloading-maven-dependency-source-jars/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 16:44:16 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Apache Maven]]></category>
		<category><![CDATA[Build Management]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[sources]]></category>

		<guid isPermaLink="false">http://andrewmccall.com/?p=440</guid>
		<description><![CDATA[I&#8217;ve been working on a new project that I&#8217;m planning to open source real soon &#8211; stay tuned.
When I&#8217;m implementing ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a new project that I&#8217;m planning to <a class="zem_slink" title="Open Source" rel="wikinvest" href="http://www.wikinvest.com/concept/Open_Source">open source</a> real soon &#8211; stay tuned.</p>
<p>When I&#8217;m implementing interfaces in a dependent package using Idea/<a class="zem_slink" title="Apache Maven" rel="homepage" href="http://maven.apache.org">Maven</a> I want to tick the &#8220;copy javadoc&#8221; button to at least have the documentation from the intereface. The issue of course is that I don&#8217;t have the sources.</p>
<p>Run the following command:</p>
<p><code>mvn dependency:sources</code></p>
<p>Maven will download any sources it can find for in remote repositories for your dependencies and Idea finds them like magic. So now not only can you copy javadoc, you can also click the line number in the stack trace and get something meaningful &#8211; not &#8220;compiled code&#8221;.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/9a1e3010-bd75-48cb-ae56-7679e62c80b8/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=9a1e3010-bd75-48cb-ae56-7679e62c80b8" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://andrewmccall.com/2009/11/downloading-maven-dependency-source-jars/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
