<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>Will Norris &#187; technology</title>
	<atom:link href="http://willnorris.com/category/technology/feed" rel="self" type="application/rss+xml" />
	<link>http://willnorris.com</link>
	<description>Thoughts on Identity, OpenID, WordPress, and Life</description>
	<lastBuildDate>Tue, 26 Jan 2010 16:25:05 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
		<item>
		<title>Going to Google</title>
		<link>http://willnorris.com/2010/01/going-to-google</link>
		<comments>http://willnorris.com/2010/01/going-to-google#comments</comments>
		<pubDate>Tue, 26 Jan 2010 16:11:49 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA["social web"]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[openid]]></category>

		<guid isPermaLink="false">http://willnorris.com/?p=903</guid>
		<description><![CDATA[I&#8217;m happy to announce today that I&#8217;ve accepted a job at Google, working on the newly formed Social Web team.  I will be joining fellow new-hires Joseph Smarr and Chris Messina, as well as a host of other incredibly talented engineers, in contributing to the emerging standards and growing developer community in this space.

Instead [...]

<div class="related-posts">
Possibly related posts:<ul><li><a href='http://willnorris.com/2008/05/why-im-going-to-vidoop' rel='bookmark' title='Permanent Link: Why I&#8217;m going to Vidoop'>Why I&#8217;m going to Vidoop</a></li>
<li><a href='http://willnorris.com/2007/02/one-year-at-usc' rel='bookmark' title='Permanent Link: One year at USC'>One year at USC</a></li>
<li><a href='http://willnorris.com/2007/02/wp-xrds' rel='bookmark' title='Permanent Link: wp-xrds'>wp-xrds</a></li>
</ul></div>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m happy to announce today that I&#8217;ve accepted a job at Google, working on the newly formed Social Web team.  I will be joining fellow new-hires <a href="http://josephsmarr.com/2009/12/18/joseph-smarr-has-new-work-info…/">Joseph Smarr</a> and <a href="http://factoryjoe.com/blog/2010/01/07/happy-birthday-to-me-im-joining-google/">Chris Messina</a>, as well as a host of other incredibly talented engineers, in contributing to the emerging standards and growing developer community in this space.</p>

<p>Instead of the long contemplative post on how this move is the next logical step in a career of working in Identity Management, I&#8217;ll keep it short.  I start work next Monday, February 1st, and I&#8217;m a bit pre-occupied this week with getting moved from Portland, Oregon down to Half Moon Bay, California.</p>

<p>I expect great things from our team in 2010, and so should you.</p>


<div class="related-posts"><p>Possibly related posts:</p><ul><li><a href='http://willnorris.com/2008/05/why-im-going-to-vidoop' rel='bookmark' title='Permanent Link: Why I&#8217;m going to Vidoop'>Why I&#8217;m going to Vidoop</a></li>
<li><a href='http://willnorris.com/2007/02/one-year-at-usc' rel='bookmark' title='Permanent Link: One year at USC'>One year at USC</a></li>
<li><a href='http://willnorris.com/2007/02/wp-xrds' rel='bookmark' title='Permanent Link: wp-xrds'>wp-xrds</a></li>
</ul></div>]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2010/01/going-to-google/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Identity and Identifiers</title>
		<link>http://willnorris.com/2010/01/identity-and-identifiers</link>
		<comments>http://willnorris.com/2010/01/identity-and-identifiers#comments</comments>
		<pubDate>Fri, 01 Jan 2010 21:23:07 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[identifiers]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[xri]]></category>

		<guid isPermaLink="false">http://willnorris.com/?p=897</guid>
		<description><![CDATA[I still remember when I made the conscious decision to go by the name &#8220;Will&#8221; instead of &#8220;William&#8221;.  I was 11 or 12 years old, and we were moving from Irving, Texas, where we had lived the last 7 years or so, to Olive Branch, Mississippi.

I don&#8217;t honestly recall why I decided to go [...]

<div class="related-posts">
Possibly related posts:<ul><li><a href='http://willnorris.com/2007/02/free-your-id' rel='bookmark' title='Permanent Link: Free Your ID'>Free Your ID</a></li>
<li><a href='http://willnorris.com/2009/08/best-practices-with-directed-identity' rel='bookmark' title='Permanent Link: Best Practices with Directed Identity'>Best Practices with Directed Identity</a></li>
<li><a href='http://willnorris.com/2009/07/openid-directed-identity-identifier-select' rel='bookmark' title='Permanent Link: Directed Identity vs Identifier Select'>Directed Identity vs Identifier Select</a></li>
</ul></div>]]></description>
			<content:encoded><![CDATA[<p><span class="right"><a href="http://www.flickr.com/photos/wnorris/4234983298/"><img src="http://farm5.static.flickr.com/4068/4234983298_fb011b8a36_t.jpg" alt="Yearbook Photos" width="81" height="100" /></a></span>I still remember when I made the conscious decision to go by the name &#8220;Will&#8221; instead of &#8220;William&#8221;.  I was 11 or 12 years old, and we were moving from Irving, Texas, where we had lived the last 7 years or so, to Olive Branch, Mississippi.</p>

<p>I don&#8217;t honestly recall why I decided to go by a different name.  Name changes are common throughout history to mark a new beginning in one&#8217;s life.  In the Bible, Abram is given the name <a href="http://read.ly/gen17.5.nkjv">Abraham</a>, Jacob is renamed <a href="http://read.ly/gen32.28.nkjv">Israel</a>, and Saul of Tarsus becomes <a href="http://read.ly/acts13.9.nkjv">Paul</a> the Apostle.  Converts to Islam will often take on a <a href="http://islamqa.com/en/ref/23273">new Islamic name</a>, and it is common for monarchs and newly elected popes to take a <a href="http://en.wikipedia.org/wiki/Regnal_name">regnal name</a> when they inherit the throne.  It is customary in many cultures to take the surname of a spouse, or a blending of the two surnames, when one is married.  Perhaps at some level I wanted to mark this new beginning in my life.  I was leaving behind everyone I knew, and would be starting fresh with school, with friends&#8230; with everything.  Maybe I wanted a new name to represent this new part of my life.  Or perhaps I was simply emulating my older brother Steven, who at the time had chosen to go by &#8220;Steve&#8221;.</p>

<p><span id="more-897"></span></p>

<p>My immediate family was pretty good about respecting my decision.  My mom later told me that when they were picking names for my brother and me, they went through all the possible nicknames and made sure they would be okay with them.  Occasionally my mom would slip and call me William, and I remember that I used to get really mad about that.  I don&#8217;t think my grandparents ever stopped calling me William, but after a while I got over it.</p>

<h2>Identity Online</h2>

<p>I think that I really started giving thought to my online identity when I was in college at George Tech.  When I was a student, we were all given a &#8220;GT Number&#8221;, which was simply an opaque username and email address.  Mine was <em>gte739u</em>, and so my email address was <em>gte739u@prism.gatech.edu</em>.  Everyone had these numbers, and we all got used to them.  Papers and tests might have a place to put your name, but they <strong>always</strong> had a place to put your GT Number.  We weren&#8217;t names, we were numbers&#8230; we were simply <code>$student++</code>.  I&#8217;ve never been one for pseudonyms, maybe because I didn&#8217;t have any real issues with my name.  Up until this point, I had always used variations of my name for accounts: <em>wnorris</em>, <em>wjnorris</em>, or <em>wjn730</em> if nothing else was available.  It was only when I no longer had that freedom to identify myself how I chose that I became aware of how important it was to me.</p>

<p>It wasn&#8217;t until my second or third semester that I was eligible to get an account in the College of Computing, which you got to choose yourself.  I was quite happy when I could finally give out a decent school email address to people &#8212; <em>wnorris@cc.gatech.edu</em>.  In a small way, I felt like <a href="http://en.wikipedia.org/wiki/Anthem_(novella)">Equality 7-2521</a> asserting his individuality, taking the name Prometheus.</p>

<p>When I began to realize the benefit of a personal homepage, I found that the domain willnorris.com was already registered, so I settled on wirewater.org instead.  I thought it sounded cool and I liked the <a href="http://www.catb.org/jargon/html/W/wirewater.html">definition</a> in the Jargon File.  I used that as my personal homepage as well as my main email address for several years, until I was able to buy willnorris.com a few years later and switch everything over to that.  I had used wirewater.org so much during those years that I decided to just keep it indefinitely.  I don&#8217;t think I ever receive legitimate email on that account anymore, but it costs so little that I don&#8217;t really worry about it.  There is a competitive market for registering &#8220;.org&#8221; domains, so I can be assured that the price will always remain at a reasonable rate.  If I want to change my registrar for whatever reason, I can easily do so.</p>

<h2>A(nother) New Identity</h2>

<p>In 2007, a new service called FreeYourID was <a href="http://blog.janrain.com/2007/02/openid-name-great-news.html">launched</a> by GNR and Janrain.  For $11 a year, you could get a third-level .name domain of the form <em>firstname</em>.<em>lastname</em>.name.  They would also forward email sent to <em>firstname</em>@<em>lastname</em>.name, and later added a few other identity related services like XFN links and redirects to your social network profiles.  The most exciting part of all this was that every FreeYourID domain was automatically an OpenID, backed by <a href="http://www.myopenid.com/">MyOpenID</a>.  It was a great example of putting individuals in control of their identity online, and how OpenID delegation fit into that picture.  Seeing the potential for this, <a href="http://willnorris.com/2007/02/free-your-id">I grabbed</a> will.norris.name on the very first day.  It wasn&#8217;t long before I started using this new URL as my primary identifier online.  I still had willnorris.com and continued to use it as a blog, but will.norris.name became my &#8220;identity site&#8221;.  It was a simple <a href="http://web.archive.org/web/20080307175926/http://will.norris.name/">landing page</a> that had contact information and links to my profiles on various services.  Later I added an activity stream, and XFN links to friends and colleagues.  More importantly though, I used it as my primary OpenID on any services that supported it.</p>

<p>About a year and half (and hundreds of OpenID logins) later, I decided that I didn&#8217;t want to maintain two sites.  I <a href="http://willnorris.com/2008/11/consolidating-domains">polled my friends</a>, and decided to migrate away from will.norris.name.  It was a very manual process of updating my various online profiles, and presented even more <a href="http://willnorris.com/2008/12/challenges-in-changing-my-openid">challenges with OpenID</a>.  But like my transition from wirewater.org I had done several years earlier, I didn&#8217;t worry too much about because the extra domain wasn&#8217;t really costing me that much.</p>

<p>That all changed this year when it was announced that FreeYourID was <a href="http://www.techcrunch.com/2009/07/25/freeyourid-gives-up-on-trying-to-monetize-openid/">shutting down</a> after just two years of operation, and that all accounts would be transitioned over to Key-Systems GmbH.  Never mind the fact that the new site to manage your registration is absolutely terrible, the cost for renewal was also raised to 23.39 &#8364; (about $35).  And unlike my previous .org registration, hours of searching and phone calls have not revealed any way to transfer a third-level .name to a different registrar (in fact, most registrars won&#8217;t even transfer second-level .name domains).  My domain was scheduled to expire in a few weeks, and I would have liked to just let it go so I don&#8217;t have to spend the $35, but there&#8217;s a little problem&#8230;</p>

<h2>OpenID and Reusable Identifiers</h2>

<p>I started the process of updating my OpenID on sites a year ago, but I&#8217;ve still identified three relying parties that do not support changing your OpenID (at least not that I can find): <a href="http://disqus.com/">Disqus</a>, <a href="http://clickpass.com/">Clickpass</a>, and <a href="http://pibb.com/">Pibb</a>.  I&#8217;m certain there are many more, but these are the only ones that I know I have accounts with, and are currently set to use will.norris.name.  So if I let my domain expire, and someone else buys it, they can immediately login to my account at these three services.  This is the way OpenID is designed to work&#8230; whoever controls the domain is able to authenticate as that URL.  So what does this mean for me?  Quite simply, it means that if I want to make sure that no one else is able to access my account on any of these three services, I&#8217;m forced to pay $35 to renew a domain I don&#8217;t use and don&#8217;t want.</p>

<p>Who&#8217;s to blame for this?  Well, I could blame Key-Systems for tripling the price of .name accounts when they took over the FreeYourId service.  I could blame myself for having bought the domain in the first place, instead of just sticking with the .com I already had.  I could blame the services listed above for not supporting OpenID changes on accounts.  And I could <a href="http://groups.google.com/group/openid/browse_thread/thread/14be357ff51029c1/388ace21c099a221?#388ace21c099a221">blame the OpenID protocol</a> itself for keying on reusable identifiers, instead of using those as aliases to unique, non-reusable identifiers like <a href="http://en.wikipedia.org/wiki/Extensible_Resource_Identifier">XRI</a> has been architected to do from the very beginning.  All of these would be fair parties to place the blame on, but this post isn&#8217;t about placing blame.  Instead, this post is about getting the technologists developing and deploying this stuff to start thinking through the entire account lifecycle.</p>

<h2>Identifiers Change</h2>

<p>We&#8217;re living in a world where the identifiers we use to refer to people online are more important than ever.  From IRC nicks to email addresses to Twitter handles.  These monikers are typically all that identifies us within a particular service context, and sometimes between contexts.  This is particularly true of Twitter handles, which in recent years have come to be seen by some as the de facto namespace for people. <span class="right"><a href="http://www.flickr.com/photos/wnorris/4234713656/"><img src="http://farm3.static.flickr.com/2627/4234713656_3ab329b85c_m.jpg" alt="WordPress Portland 2009 Name Badge" width="180" height="240" /></a></span> I was more than a little upset when my former employer (a company focused on OpenID, no less) linked to my Twitter profile instead of my personal homepage when <a href="http://web.archive.org/web/20080523225546/blog.vidoop.com/archives/111">they announced</a> my hiring.  And again this year at WordCamp Portland, it was disheartening to discover that the <a href="http://www.flickr.com/photos/wnorris/4234713656/">attendee name badges</a> had a place for your Twitter handle, but not for your blog URL.  At a <a href="http://wordcamp.org/">WordCamp</a>!  The emphasis on our identifiers on these services makes it increasingly difficult to change your identifier without breaking things.  But the fact is, identifiers do change.  As our online and offline worlds collide, more and more people are moving away from pseudonyms toward using real identities online (something Facebook had the forethought to <em>require</em> from the very beginning).  While this is of course a personal decision, it&#8217;s one that <a href="http://factoryjoe.com/blog/2009/03/02/rip-factoryjoe/">Chris Messina</a> recently undertook.  Similarly, <a href="http://twitter.com/plasticbagUK/status/6037730041">Tom Coates</a> and <a href="http://twitter.com/dotBen/status/6657847636">Ben Metcalfe</a>, two individuals who understand online identity and social media <strong>very</strong> well, have considered doing the same.</p>

<p>I guess my point is just this.  Identity is important.  And identifiers change.  So we need to be ready for that as we continue to build the &#8220;social web&#8221;.</p>


<div class="related-posts"><p>Possibly related posts:</p><ul><li><a href='http://willnorris.com/2007/02/free-your-id' rel='bookmark' title='Permanent Link: Free Your ID'>Free Your ID</a></li>
<li><a href='http://willnorris.com/2009/08/best-practices-with-directed-identity' rel='bookmark' title='Permanent Link: Best Practices with Directed Identity'>Best Practices with Directed Identity</a></li>
<li><a href='http://willnorris.com/2009/07/openid-directed-identity-identifier-select' rel='bookmark' title='Permanent Link: Directed Identity vs Identifier Select'>Directed Identity vs Identifier Select</a></li>
</ul></div>]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2010/01/identity-and-identifiers/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Java OpenID Library - Target Audience</title>
		<link>http://willnorris.com/2009/12/java-openid-library-target-audience</link>
		<comments>http://willnorris.com/2009/12/java-openid-library-target-audience#comments</comments>
		<pubDate>Thu, 24 Dec 2009 20:02:48 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[shibboleth]]></category>

		<guid isPermaLink="false">http://willnorris.com/?p=895</guid>
		<description><![CDATA[One of the decisions that has to be made, or at least considered, early in the design of any software project is identifying your target audience.  This is especially true of libraries that are designed to be integrated into other applications.  Who do you expect to be using this library, and how do [...]

<div class="related-posts">
Possibly related posts:<ul><li><a href='http://willnorris.com/2009/11/java-openid-library-design-message-handling' rel='bookmark' title='Permanent Link: Java OpenID Library Design - Message Handling'>Java OpenID Library Design - Message Handling</a></li>
<li><a href='http://willnorris.com/2009/11/java-openid-library-configuration-and-custom-messages' rel='bookmark' title='Permanent Link: Java OpenID Library - Configuration and Custom Messages'>Java OpenID Library - Configuration and Custom Messages</a></li>
<li><a href='http://willnorris.com/2007/04/shibboleth-definition' rel='bookmark' title='Permanent Link: Shibboleth definition'>Shibboleth definition</a></li>
</ul></div>]]></description>
			<content:encoded><![CDATA[<p>One of the decisions that has to be made, or at least considered, early in the design of any software project is identifying your target audience.  This is especially true of libraries that are designed to be integrated into other applications.  Who do you expect to be using this library, and how do you expect them to make use of it?  Is it something like <a href="http://logging.apache.org/log4j/">log4j</a> that can be dropped into place and used with just a few lines of additional code?  Or is it something that is intended to be integrated into a larger system, requiring the developer using the library to provide additional logic and business rules to get things working?  Something that might require a non-trivial amount of effort, depending on the needs of the use-case.  There is no right or wrong answer, and oftentimes it&#8217;s somewhere in between, but it&#8217;s something that must be considered.</p>

<p>Some of the best software libraries I&#8217;ve used address both ends of the spectrum.  There&#8217;s a common adage in software development (and I&#8217;m sure it goes back farther than that): &#8220;make the common things easy, and the hard things possible&#8221;.  First, you don&#8217;t want to make things any harder than necessary for the majority of users that are just using the basic functionality of a library.  If they don&#8217;t care about customizing and tweaking every little aspect of it, then the way they interact with the library should be relatively simple and straightforward.  But for those users that have unique needs, the library should allow them to configure it in such a way to accommodate that.  It is certainly my goal to address both extremes in the Shibboleth OpenID library, but it will happen in phases.</p>

<p>The first phase will address the edge-cases, those users of the library that tend to have unique needs and requirements.  That may seem backwards, but I assure you it isn&#8217;t.  First of all, the really practical reason for starting here is that Shibboleth is itself an edge case.  The reason I chose not to use the existing Java OpenID libraries in the first place was that they didn&#8217;t adequately conform to the way Shibboleth needed them to work.  But from a design perspective, I&#8217;ve found that this approach tends to yield better results anyway.</p>

<h2>Small Pieces Loosely Coupled</h2>

<p>I&#8217;ve learned that in order to make a system really flexible and modular, it&#8217;s best to architect it that way from the very beginning.  You have to decide where the logical divisions of labor are within the system, and then translate that into the code itself.  Each component should be relatively self-contained, it&#8217;s purpose should be clear, and its interface (the way it interacts with other components) should be separated from its actual implementation.  Sometimes these components are obvious, and there are clear places where the code should be divided.  But more often than not, its a judgement call.  Architecture is often harder than actual construction, whether you&#8217;re talking about software or brick and mortar.  It requires a lot of creativity because you&#8217;re often working from a blank canvas, but it also requires that your plans are grounded in what is actually possible.  Architectural plans are worthless if they can&#8217;t actually be implemented in the real world in a practical way.  By no means do I think that I&#8217;ve found the best architecture for this library, because it&#8217;s always subjective.  Fortunately, I&#8217;ve had <a href="http://opensaml.org/">similar libraries</a> that I&#8217;ve borrowed from heavily for inspiration, as well as much smarter developers that I work with to bounce ideas off of.</p>

<p>At its core, this library is an OpenID messaging library.  It is capable of converting between generic HTTP messages and strongly typed OpenID objects that developers can work with.  My last two posts have talked about this in detail.  The library also provides the additional logic for implementing the OpenID specification, things like Diffie Hellman key exchange and OpenID message signing.  What the library does <strong>not</strong> do is tell you how you must compose these pieces into a working system.  That&#8217;s because there isn&#8217;t just one way to do it.  It greatly depends on the application that is wanting to add OpenID support.  If you&#8217;re using a Java framework like <a href="http://tapestry.apache.org/">Tapestry</a> or <a href="http://java.sun.com/javaee/javaserverfaces/">JSF</a>, perhaps you have other processing that happens to the message before the OpenID library gets involved.  How does the user get authenticated and where do the user attributes come from?  I have no idea&#8230; that&#8217;s up to your application to decide.  At this level, the library makes no assumptions (or at least as few as possible) about how all of these small pieces should be coupled together.</p>

<p>If this sounds like a lot of work left up to the user just for something as simple as OpenID, you&#8217;re right&#8230; it is a lot of work.  But when you really need that level of control, it&#8217;s important that the library support that.</p>

<h2>Addressing the Common Case</h2>

<p>So what about everyone else, all the &#8220;mere mortals&#8221; who <em>don&#8217;t</em> need that much control, and just want to add OpenID support to some application using the default configuration?  At a high level, I&#8217;d love to have a Servlet Filter that you can drop in front of your application, configure a few small things, and have it <strong>just work</strong> as an OpenID relying party.  I&#8217;ve always been a huge fan of the Tapestry framework, so I&#8217;d love to have a Tapestry component that can be dropped in just as easily.  All of these things are possible by building a layer that sits on top of those individual components in the library, and arranges them in a prescribed way.</p>

<p>Now, I don&#8217;t anticipate that a drop-in Servlet Filter will ever be a part of the core library, because I don&#8217;t think it belongs there.  It would be a separate deliverable unto itself that simply relies on the library to do all of OpenID work.  This also means that the Filter wouldn&#8217;t necessarily need to come from me, anyone could write it and make it available.  I don&#8217;t imagine that the core library itself will ever have everything that the &#8220;common case&#8221; users will need.  And I&#8217;m okay with that, because I&#8217;m not building an OpenID product, I&#8217;m building an OpenID library.</p>

<h2>Current Status</h2>

<p>This is by no means a complete picture of the Shibboleth OpenID library, but it should give you a rough idea.  It identifies some of the larger components of the libraries, and some of the interdependencies.</p>

<p><img src="http://farm3.static.flickr.com/2518/4211756452_3e7d278f3a.jpg" alt="OpenID Java Software Stack (v1)" width="364" height="256" /></p>

<p>The orange blocks are pieces that are basically complete and present in the current library.  All of the message handling is complete for OpenID 2.0 message, as well as three of the most popular message extensions (SReg, AX, and PAPE).  Additionally, association management is done, and a very simple AssociationStore is provided (though it needs a little improvement).  The security layer is complete insofar as signing and verifying signed messages.  The yellow blocks represent pieces that are not yet complete, but will be included in the core library in the future.  The discovery component is still up in the air a little bit because it&#8217;s not completely clear if we&#8217;ll be using XRD, XRDS, or both.  The portions of the security layer that depend on discovery are, of course, waiting on the completion of the discovery stack.  Those pieces include everything that an application would need to construct an OpenID provider or relying party.  They implement the full OpenID protocol.</p>

<p>But those components alone leave a lot to be filled in by the application using the library.  It says nothing about how an incoming HttpServletRequest object is converted into an OpenID Message.  The application would be responsible for instantiating the specific objects and wiring them together to actually get a working AssociationManager.  And for applications that wish to have control over these specific aspects of an OpenID flow, this is a good thing.  The next layer up on the stack however, the yellow &#8220;Managers&#8221; block, will provide simple Manager objects that wire things together in a prescribed way.  Most users of the library will deal with the Manager layer, and probably nothing else.  Only when they have specific needs will it be necessary to dig any deeper.</p>

<p>Now this last layer is actually nothing special&#8230; it&#8217;s a very common pattern, and both <a href="http://openid4java.org/">OpenID4Java</a> and <a href="http://code.google.com/p/joid/">Joid</a> work in very similar ways.  I point it out only to note that while this layer will be part of the core library in a future release, it isn&#8217;t right now.  Much of the code that will likely make up these components has already been written, but in the form of the <a href="https://spaces.internet2.edu/display/SHIB2/IdP+OpenID">Shibboleth IdP extension</a>.  For the last few months I&#8217;ve been simultaneously building both a generic OpenID library, as well as an actual product that makes use of the library.   One of the tougher ongoing challenges while doing this is in deciding which of the two projects a particular bit of code goes into.  Much of the time it&#8217;s clear, but when in doubt, I&#8217;ll put something into the Shibboleth extension rather than the library.  If anything, I want to err on the side of keeping the library &#8220;pure&#8221; so to speak.  To not accidentally bake any assumptions into the library itself that might limit its flexibility.  One of my focuses after the holidays will be in identifying which pieces need to be refactored from the Shibboleth extension back into the core library in order to build out that management layer.</p>

<p>(And in case it&#8217;s not clear, the final layer in grey in the stack above are other pieces that will make use of the OpenID library, but will likely not be part of the library itself.)</p>


<div class="related-posts"><p>Possibly related posts:</p><ul><li><a href='http://willnorris.com/2009/11/java-openid-library-design-message-handling' rel='bookmark' title='Permanent Link: Java OpenID Library Design - Message Handling'>Java OpenID Library Design - Message Handling</a></li>
<li><a href='http://willnorris.com/2009/11/java-openid-library-configuration-and-custom-messages' rel='bookmark' title='Permanent Link: Java OpenID Library - Configuration and Custom Messages'>Java OpenID Library - Configuration and Custom Messages</a></li>
<li><a href='http://willnorris.com/2007/04/shibboleth-definition' rel='bookmark' title='Permanent Link: Shibboleth definition'>Shibboleth definition</a></li>
</ul></div>]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2009/12/java-openid-library-target-audience/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Java OpenID Library - Configuration and Custom Messages</title>
		<link>http://willnorris.com/2009/11/java-openid-library-configuration-and-custom-messages</link>
		<comments>http://willnorris.com/2009/11/java-openid-library-configuration-and-custom-messages#comments</comments>
		<pubDate>Mon, 16 Nov 2009 04:34:00 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[internet2]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[openid]]></category>

		<guid isPermaLink="false">http://willnorris.com/?p=893</guid>
		<description><![CDATA[I previously described how message handling works in the Internet2 OpenID library, and how each OpenID message type requires a half dozen or so classes to handle everything.  While this may seem like overkill to some, one of the nice things about this separation of logic is that it makes it quite simple to [...]

<div class="related-posts">
Possibly related posts:<ul><li><a href='http://willnorris.com/2009/11/java-openid-library-design-message-handling' rel='bookmark' title='Permanent Link: Java OpenID Library Design - Message Handling'>Java OpenID Library Design - Message Handling</a></li>
<li><a href='http://willnorris.com/2009/12/java-openid-library-target-audience' rel='bookmark' title='Permanent Link: Java OpenID Library - Target Audience'>Java OpenID Library - Target Audience</a></li>
<li><a href='http://willnorris.com/2003/06/away-messages' rel='bookmark' title='Permanent Link: away messages'>away messages</a></li>
</ul></div>]]></description>
			<content:encoded><![CDATA[<p>I <a href="http://willnorris.com/2009/11/java-openid-library-design-message-handling">previously described</a> how message handling works in the Internet2 OpenID library, and how each OpenID message type requires a half dozen or so classes to handle everything.  While this may seem like overkill to some, one of the nice things about this separation of logic is that it makes it quite simple to provide custom implementations of specific kinds of messages.  While this was not specifically a core requirement of the library, it was an added bonus of the design, and just seemed like a good thing to support.  I want to talk about it here, because it illustrates how this portion of the library is configured, which will be important to understand later.</p>

<h2>Central Registry</h2>

<p>As we mentioned, every OpenID message type has a number of supporting classes.  Let&#8217;s take the authentication request message as an example.  You have:</p>

<ul>
<li><a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/AuthenticationRequest.java?view=markup">AuthenticationRequest</a> &#8212; interface that defines this specific OpenID message type</li>
<li><a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/impl/AuthenticationRequestImpl.java?view=markup">AuthenticationRequestImpl</a> &#8212; default implementation of this message type</li>
<li><a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/impl/AuthenticationRequestBuilder.java?view=markup">AuthenticationRequestBuilder</a> &#8212; builder of AuthenticationRequest instances</li>
<li><a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/impl/AuthenticationRequestMarshaller.java?view=markup">AuthenticationRequestMarshaller</a> &#8212; converts AuthenticationRequest message into a ParameterMap</li>
<li><a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/impl/AuthenticationRequestUnmarshaller.java?view=markup">AuthenticationRequestUnmarshaller</a> &#8212; converts ParameterMap into an AuthenticationRequest message</li>
<li><a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/impl/AuthenticationRequestValidator.java?view=markup">AuthenticationRequestValidator</a> &#8212; this wasn&#8217;t talked about last time, but is responsible for validating that an AuthenticationRequest message contains all of the requisite parameters</li>
</ul>

<p>All classes except for the actual message implementation must be thread-safe, as only a single instance is maintained by the library (technically they don&#8217;t follow a singleton pattern, but only one instance is typically used).  All of these are stored in central registries, so that they can be retrieved to marshall or unmarshall a message as needed.  Each one has it&#8217;s own factory that allows registering and looking up of specific implementations:</p>

<ul>
<li><a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/MessageBuilderFactory.java?view=markup">MessageBuilderFactory</a></li>
<li><a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/io/MessageMarshallerFactory.java?view=markup">MessageMarshallerFactory</a></li>
<li><a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/io/MessageUnmarshallerFactory.java?view=markup">MessageUnmarshallerFactory</a></li>
<li>MessageValidatorFactory (not yet implemented as of this writing)</li>
</ul>

<p>MessageValidator implementations are registered based on the message class that it validates. For the other three factories, implementations are registered based on a <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/namespace/QName.html">QName</a> which consists of the OpenID protocol namespace URI, and the value of the mode parameter.  Yes, there are three OpenID message types that don&#8217;t actually have a &#8216;mode&#8217; parameter, but I&#8217;ll save that discussion for another post.  Also, the QName here doesn&#8217;t exactly represent a namespaced parameter name like it does in the <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/common/ParameterMap.java?view=markup">ParameterMap</a>, instead it is just a container for a namespace URI and a string value.  Perhaps this is technically a misuse of the QName object, but it&#8217;s working fine for now.  A static instance of each factory is available from the <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/Configuration.java?view=markup">Configuration</a> class.</p>

<h2>Message Flow (redux)</h2>

<p>So now let&#8217;s go through a message flow like we did last time, and look at how each of the factories are used.  (At the time of this writing, I&#8217;m still working on hooking in the MessageValidators, so I won&#8217;t be talking much about that).</p>

<p>Remember that when a message comes in, it is in some kind of transport specific encoding.  Depending on how the message was received and the format it is in, an appropriate MessageDecoder is used to convert it into a ParameterMap.  The next step is to find an appropriate MessageUnmarshaller to convert this ParameterMap into an actual Message object.  The MessageUnmarshallerFactory has a <code>getUnmarshaller(ParameterMap)</code> method that will lookup exactly what we need.  Once we have an unmarshaller, we can call its <code>unmarshall(ParameterMap)</code>.  This method is responsible for building an appropriate Message object, and then populating it based on the data provided in the ParameterMap.  Internally, the unmarshaller uses the MessageBuilderFactory to find an appropriate MessageBuilder using the <code>getBuilder(ParameterMap)</code> method.  Once the correct builder is obtained, its <code>buildObject()</code> method is called to get an instance of the Message object.  This instance is then populated using data from the ParameterMap and returned.  (If anyone wants to volunteer a flow chart that illustrates this, I&#8217;d be greatly appreciative!)</p>

<p>When it comes time to send a message back out, the MessageMarshallerFactory&#8217;s <code>getMarshaller(Message)</code> method is called to get the correct MessageMarshaller for a given message.  The marshaller&#8217;s <code>marshall(Message)</code> method is called and returns a ParameterMap, and that is passed through an appropriate MessageEncoder to send it out on the wire.</p>

<h2>Custom Implementations</h2>

<p>The library comes with default implementations for all of this, so a user can simply choose to ignore all of this plumbing and be just fine.  But just in case you <strong>do</strong> want to customize part of this, how would you go about doing so?  Simply by registering them with the appropriate factory.  Let&#8217;s say you want to provide your own AssociationRequest implementation for whatever reason.  But maybe you don&#8217;t necessarily care to customize the way the data is unmarshalled into and marshalled out of the object&#8230; the default implementations for those are fine.  You would of course have your custom AssociationRequest:</p>

<pre><code>public class MyAssociationRequest implements AssociationRequest {
    /* implementation here */
}
</code></pre>

<p>Then to make sure that your custom implementation is built instead of the default implementation provided by the library, you would also need to provide a MessageBuilder:</p>

<pre><code>public class MyAssociationRequestBuilder implements 
             MessageBuilder&lt;AssociationRequest&gt; {

    public AssociationRequest buildObject() {
        /* build and return an instance of MyAssociationRequest */
    }
}
</code></pre>

<p>Then register your message builder:</p>

<pre><code>MessageBuilder myBuilder = new MyAssociationRequestBuilder();
QName qname = new QName(OpenIDConstants.OPENID_20_NS, AssociationRequest.MODE);
Configuration.getMessageBuilders().registerBuilder(qname, myBuilder);
</code></pre>

<p>Once your builder is registered, it will be used to build AssociationRequest objects for all incoming messages of that type.  However, the default marshaller and unmarshaller for that type will continue to be used&#8230; you don&#8217;t need to worry about that.  And once I get the validators hooked in, that will <em>just work</em> as well with your custom class.  Or, you could provide your own Validators if you like. You can customize as much or as little of the library as you want.</p>

<p>I don&#8217;t imagine that anyone will want to provide custom message implementations very often, but the option is most certainly there.  What is far more likely is providing a custom message extension like Attribute Exchange or PAPE.  That works in very much the same way, which I&#8217;ll explain next.</p>


<div class="related-posts"><p>Possibly related posts:</p><ul><li><a href='http://willnorris.com/2009/11/java-openid-library-design-message-handling' rel='bookmark' title='Permanent Link: Java OpenID Library Design - Message Handling'>Java OpenID Library Design - Message Handling</a></li>
<li><a href='http://willnorris.com/2009/12/java-openid-library-target-audience' rel='bookmark' title='Permanent Link: Java OpenID Library - Target Audience'>Java OpenID Library - Target Audience</a></li>
<li><a href='http://willnorris.com/2003/06/away-messages' rel='bookmark' title='Permanent Link: away messages'>away messages</a></li>
</ul></div>]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2009/11/java-openid-library-configuration-and-custom-messages/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Java OpenID Library Design - Message Handling</title>
		<link>http://willnorris.com/2009/11/java-openid-library-design-message-handling</link>
		<comments>http://willnorris.com/2009/11/java-openid-library-design-message-handling#comments</comments>
		<pubDate>Sat, 14 Nov 2009 00:16:52 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[internet2]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[joid]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[openid4java]]></category>
		<category><![CDATA[shibboleth]]></category>

		<guid isPermaLink="false">http://willnorris.com/?p=888</guid>
		<description><![CDATA[This past June I contracted with Internet2 to work on adding OpenID support to the Shibboleth Identity Provider.  I had actually started to work on this over a year prior while working at USC.  At the time there were (and still are) two primary OpenID libraries in Java, Verisign&#8217;s JOID, and Sxip&#8217;s OpenID4Java. [...]

<div class="related-posts">
Possibly related posts:<ul><li><a href='http://willnorris.com/2009/11/java-openid-library-configuration-and-custom-messages' rel='bookmark' title='Permanent Link: Java OpenID Library - Configuration and Custom Messages'>Java OpenID Library - Configuration and Custom Messages</a></li>
<li><a href='http://willnorris.com/2009/12/java-openid-library-target-audience' rel='bookmark' title='Permanent Link: Java OpenID Library - Target Audience'>Java OpenID Library - Target Audience</a></li>
<li><a href='http://willnorris.com/2005/03/classnotfound' rel='bookmark' title='Permanent Link: A class needed by class &lt;&#8230;&gt; cannot be found: org/apache/tools/ant/Task'>A class needed by class &lt;&#8230;&gt; cannot be found: org/apache/tools/ant/Task</a></li>
</ul></div>]]></description>
			<content:encoded><![CDATA[<p>This past June I contracted with <a href="http://internet2.edu/">Internet2</a> to work on adding OpenID support to the <a href="http://shibboleth.internet2.edu/">Shibboleth</a> Identity Provider.  I had actually started to work on this over a year prior while working at USC.  At the time there were (and still are) two primary OpenID libraries in Java, Verisign&#8217;s <a href="http://code.google.com/p/joid/">JOID</a>, and Sxip&#8217;s <a href="http://code.google.com/p/openid4java/">OpenID4Java</a>.  I spent a fair amount of time looking at both libraries, but ultimately decided they weren&#8217;t going to work for what Shibboleth needed.  There were architectural issues with the existing libraries, which I pointed out in <a href="http://groups.google.com/group/openid4java/browse_thread/thread/f0775348b3b7f3f/f93d22fe21a6e37e">my post</a> to the OpenID4Java mailing list.  But there were also significant design decisions that I felt could be improved upon, so I began work on a new OpenID library in Java.  Now that this library is nearing a usable state, I wanted to talk about some of the architectural decisions that were made, and how it differs from the existing Java libraries for OpenID.</p>

<p>Let me first preface this by clarifying that I&#8217;m not saying the existing OpenID libraries are not usable.  Quite the contrary, I know that the OpenID4Java library is used for AOL&#8217;s OpenID provider, on Google&#8217;s Blogger, as part of Sun&#8217;s <a href="https://opensso.dev.java.net/">OpenSSO</a>, and countless other projects.  Additionally, JOID powers Verisign&#8217;s very usable <a href="https://pip.verisignlabs.com/">PIP</a>.  There is no question that they work for many use cases.  However, they lack the clean architecture I was looking for, which can really only be corrected by starting from a blank canvas.</p>

<p>(I&#8217;m not sure how many posts this will take, or how sensical the order of things will be, but better to go ahead and get it written down in <em>some</em> form.)</p>

<h2>Message Handling Flow</h2>

<p>One of the most immediate differences you&#8217;ll see in the Internet2 library is the very clear separation of logic in the message handling code.  I wanted the core message objects to be simple Java beans that provide access to strongly typed properties, and nothing more.  When I&#8217;m processing an OpenID message, I don&#8217;t want to be thinking about how that message was encoded during transit.  Additionally, I don&#8217;t want to duplicate code if at all possible, so there needs to be one very clear place where any particular process is implemented.  To achieve this, messages are transformed into three distinct formats as they are being processed.</p>

<p>When a message comes in to an OpenID provider, it is in some kind of transport specific format.  Typically that will be a URL-encoded string that is taken either from an HTTP POST request body, or from an HTTP GET request query string.  Alternately, it may be a Map retrieved by calling <a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParameterMap()">ServletRequest.getParameterMap</a>.  This transport specific format needs to first be converted into some kind of common intermediary format so that the next step in the process can deal with all messages in the same way, regardless of transport method.  In the Internet2 library, this common format is a ParameterMap.</p>

<h3>ParameterMap</h3>

<p>A <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/common/ParameterMap.java?view=markup">ParameterMap</a> is simply a <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/LinkedHashMap.html">LinkedHashMap</a> with <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/namespace/QName.html">QName</a> keys, String values, and a little additional logic.  Why QNames for keys?  Aren&#8217;t those for XML?  Yes they are, but they actually work beautifully for OpenID message parameters as well.  You see, an OpenID message is really just a collection of namespace qualified parameters, and can be quite easily represented in XML.  (Yes, this is a little bit of a rabbit trail, but it&#8217;s interesting nonetheless).  Let&#8217;s start with a really simple KVF encoded OpenID message:</p>

<pre><code>openid.ns:http://specs.openid.net/auth/2.0
openid.mode:checkid_setup
openid.claimed_id:http://example.com/
openid.identity:http://example.com/
openid.ns.sreg:http://openid.net/extensions/sreg/1.1
openid.sreg.required:email,fullname
</code></pre>

<p>Yeah it has no signature, etc, but that&#8217;s not the point.  What might this look like in XML?</p>

<pre><code>&lt;message xmlns="http://specs.openid.net/auth/2.0" 
         xmlns:sreg="http://openid.net/extensions/sreg/1.1"&gt;
    &lt;mode&gt;checkid_setup&lt;/mode&gt;
    &lt;claimed_id&gt;http://example.com/&lt;/claimed_id&gt;
    &lt;identity&gt;http://example.com/&lt;/identity&gt;
    &lt;sreg:required&gt;email,fullname&lt;/sreg:required&gt;
&lt;/message&gt;
</code></pre>

<p>See how cleanly it maps?  This is no accident.  This is a very common pattern for handling namespace qualified parameters.  First you assign your namespace to an alias, then you use that alias as a prefix for any parameters that are part of that namespace.  The simple registration &#8216;required&#8217; parameter name has three parts: there&#8217;s the base parameter name (&#8220;required&#8221;), the namespace alias (&#8220;sreg&#8221;), and the actual namespace URI which is declared separately (&#8220;http://openid.net/extensions/sreg/1.1&#8221;).  A Java QName object consists of three parts: a namespace URI, a local part, and a namespace prefix.  Slightly different terms, but <strong>exactly</strong> the same concepts.</p>

<p>Okay, so back to our OpenID library.  We&#8217;ve taken our transport specific encoding, passed it through an appropriate <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/encoding/MessageDecoder.java?view=markup">MessageDecoder</a>, and ended up with a ParameterMap.  Before we move on, I want to point out one more thing about the parameters in a ParameterMap.  None of the parameter names contain the &#8220;openid.&#8221; prefix.  This prefix is specific to messages that are encoded using <a href="http://openid.net/specs/openid-authentication-2_0.html#rfc.section.4.1.2">URL Form encoding</a>, since that&#8217;s the only way to identify which parameters are part of the OpenID message.  One of the jobs of the <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/encoding/impl/URLFormCodec.java?view=markup">URLFormCodec</a> is to strip this prefix as messages come in, and add the prefix as messages go out.  The message encoder and decoder is the <strong>only</strong> part of the entire library that knows anything about this prefix, and quite frankly it&#8217;s the only part that should.</p>

<p>Okay, so now that we have our ParameterMap, it needs to be converted into an actual message object, which is the job for a MessageUnmarshaller.</p>

<h3>Unmarshalling messages</h3>

<p><a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/io/MessageUnmarshaller.java?view=markup">Message unmarshallers</a> are responsible for taking a ParameterMap and using it to populate a specific kind of message object.  Remember the desire for message objects to have strongly typed properties?  The corresponding unmarshaller for that message type is the one and only place that needs to worry with how the parameter passed on the wire gets converted into that strong type.  For example, <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/AssociationRequest.java?view=markup">AssociationRequest</a> messages may include the Diffie-Hellman public key of the OpenID relying party.  Java provides a very specific object just for that called <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/crypto/interfaces/DHPublicKey.html">DHPublicKey</a>, so that&#8217;s what we want our AssociationRequest object to use.  Parameters can only be passed as strings during transit, so the <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/impl/AssociationRequestUnmarshaller.java?view=markup">AssociationRequestUnmarshaller</a> (and nothing else) is responsible for knowing how to convert that string into a DHPublicKey.</p>

<p>Similarly, Attribute Exchange fetch requests may include a list of required attributes it wants for a user.  These attributes are identified by URIs, so Attribute Exchange does it&#8217;s own aliasing similar to the namespace declarations we saw above.  This way, the &#8220;ax.required&#8221; message parameter need only contain a comma-separated list of attribute aliases rather than the full namespace URIs.  But when you get right down to it, these aliases are just an optimization that is used during transport.  Really all that&#8217;s being represented is a list of attributes URIs.  This is why the <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/extensions/ax/FetchRequest.java?view=markup">FetchRequest</a> object in the Internet2 library exposes this particular message parameter simply as a List of attribute URIs.  It&#8217;s the <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/extensions/ax/impl/FetchRequestUnmarshaller.java?view=markup">FetchRequestUnmarshaller</a> that is responsible for taking the AX message parameters, dereferencing the attribute aliases, and populating the FetchRequest object appropriately.</p>

<h3>Reversing the process</h3>

<p>What about returning OpenID response messages?  We just do the same process in reverse.  The message object is passed through an appropriate <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/io/MessageMarshaller.java?view=markup">MessageMarshaller</a> which populates a ParameterMap.  And the ParamerMap is in turn passed through a <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/message/encoding/MessageEncoder.java?view=markup">MessageEncoder</a> that produces some kind of transport specific format.  That may be a Key-Value form encoded string, as is the case with direct responses, it may be a URL suitable for redirecting the user to, or it may be an HTML response to use for HTML form submission.</p>

<h2>Uniformity over brevity</h2>

<p>Depending on how you separate them, there are roughly nine different message types in the core OpenID 2.0 spec, and for each of these message types, the Internet2 library has five files that handle the processing.  There&#8217;s the message interface, the concrete implementation, the message builder (which I didn&#8217;t actually talk about in this post), the message marshaller, and the message unmarshaller.  At times all these files may seem needlessly verbose, especially when you see that some of them are only a few lines long.  It turns out that this separation doesn&#8217;t necessarily result in more lines of code, just that the code is broken up into smaller chunks.  Besides, the goal here is not conciseness.  The goal is uniformity and predictability in how messages are processed, as well as clean, logical separation of duties.  When every message is processed in exactly the same way, bugs tend to expose themselves much earlier in the process, and strange edge cases are far rarer.  When things are logically separated, it makes the overall architecture much easier to understand.  And perhaps more importantly, it makes it possible to fully understand one part of the library without needing to be concerned with others.  You can go in and look at the code for <a href="http://svn.middleware.georgetown.edu/view/java-openid/trunk/src/main/java/edu/internet2/middleware/openid/security/SecurityUtils.java?view=markup">signing messages</a>, and not have to wade through code dealing with transport encodings.</p>


<div class="related-posts"><p>Possibly related posts:</p><ul><li><a href='http://willnorris.com/2009/11/java-openid-library-configuration-and-custom-messages' rel='bookmark' title='Permanent Link: Java OpenID Library - Configuration and Custom Messages'>Java OpenID Library - Configuration and Custom Messages</a></li>
<li><a href='http://willnorris.com/2009/12/java-openid-library-target-audience' rel='bookmark' title='Permanent Link: Java OpenID Library - Target Audience'>Java OpenID Library - Target Audience</a></li>
<li><a href='http://willnorris.com/2005/03/classnotfound' rel='bookmark' title='Permanent Link: A class needed by class &lt;&#8230;&gt; cannot be found: org/apache/tools/ant/Task'>A class needed by class &lt;&#8230;&gt; cannot be found: org/apache/tools/ant/Task</a></li>
</ul></div>]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2009/11/java-openid-library-design-message-handling/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>OpenID and WordPress Core</title>
		<link>http://willnorris.com/2009/09/openid-and-wordpress-core</link>
		<comments>http://willnorris.com/2009/09/openid-and-wordpress-core#comments</comments>
		<pubDate>Tue, 29 Sep 2009 20:17:19 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-openid]]></category>

		<guid isPermaLink="false">http://willnorris.com/?p=878</guid>
		<description><![CDATA[This was actually a comment I left on my last post about the v3.3 release of the OpenID plugin.  It is a topic that comes up relatively often, and one in which most people are surprised when they hear my stance on it.  It&#8217;s worthy of a separate discussion for those that are [...]

<div class="related-posts">
Possibly related posts:<ul><li><a href='http://willnorris.com/2009/09/wordpress-openid-v3-3' rel='bookmark' title='Permanent Link: WordPress OpenID v3.3'>WordPress OpenID v3.3</a></li>
<li><a href='http://willnorris.com/2007/09/wordpress-openid-20-coming-soon' rel='bookmark' title='Permanent Link: WordPress OpenID 2.0 (coming soon?)'>WordPress OpenID 2.0 (coming soon?)</a></li>
<li><a href='http://willnorris.com/2008/05/changes-to-wp-openid' rel='bookmark' title='Permanent Link: Changes to wp-openid'>Changes to wp-openid</a></li>
</ul></div>]]></description>
			<content:encoded><![CDATA[<p><em>This was actually <a href="http://willnorris.com/2009/09/wordpress-openid-v3-3#comment-35595">a comment</a> I left on my last post about the v3.3 release of the OpenID plugin.  It is a topic that comes up relatively often, and one in which most people are surprised when they hear my stance on it.  It&#8217;s worthy of a separate discussion for those that are interested, so I&#8217;ve pulled it out into a separate post.</em></p>

<p>I’ve talked with core team about this numerous times… in fact, I spoke at <a href="http://wordcampportland.org/">WordCamp Portland</a> and <a href="http://wordcampseattle.com/">Seattle</a> these last two weeks and talked with <a href="http://ma.tt/">Matt</a> about it. For the most part, I actually agree with him that OpenID doesn’t necessarily belong in core, at least not yet.</p>

<p>There’s a lot of thought being given to how WordPress can serve as your “digital hub” on the web. Right now, Automattic is playing in that space in the form of <a href="http://buddypress.org/">BuddyPress</a>. Now right now, BP allows you to create another social network silo. BP installations don’t talk to each other, and there’s no way to use your account on one BP network to login to a different BP network. I talked with <a href="http://markjaquith.com/">Mark Jaquith</a> this weekend about my desire to see this outward facing functionality. For that, I think OpenID becomes painfully obvious.</p>

<p>I would also like to see this OpenID plugin deployed on WordPress.com to replace the existing plugin. Currently, <a href="http://support.wordpress.com/settings/openid/">all WP.com blogs are OpenIDs</a>, but you can’t login or leave comments using an external OpenID. And currently, almost no one uses the existing OpenID provider. Of course, I would argue that this is because they haven’t done a good job of promoting it or adding any new features like SReg or AX. Using my OpenID plugin would greatly enhance the OpenID provider functionality on WP.com, and it would allow people to use OpenID when leaving comments. Some of the changes that are included in 3.3 are actually steps toward cleaning up the plugin so that it is more suitable for deploying on WordPress.com. There’s still more work to be done on this front, but it’s something I intend to continue pursuing.</p>

<p>As for inclusion in WordPress core, I just don’t think we’re there yet. The OpenID plugin is <a href="http://wordpress.org/extend/plugins/openid/stats/">pretty popular</a>, but it is far from having the critical mass that would justify inclusion in core. I am a firm believer that WordPress should by no means try and include every cool feature under the sun in core. It would quickly grow out of control. I do believe, however, that the appropriate hooks should be provided in core to allow any cool feature under the sun to be added as a plugin. The core dev team agrees with me on this, and they’ve been very good about making whatever changes were necessary to allow plugins to provide that functionality. In fact, I overhauled how the <a href="http://willnorris.com/2009/03/authentication-in-wordpress-28">authentication system</a> is extended in WordPress 2.8 simply to make things like OpenID and OAuth much easier to implement.</p>

<p>A few other things I’d want to see fixed before considering inclusion in core… the OpenID plugin weighs in at what? almost 900K? Remove the screenshots and readme.txt and you’ve got 700K left. Over 500K of that is the <a href="http://openidenabled.com/php-openid/">JanRain OpenID library</a>. So size is an issue. Also, the biggest problem that people have with getting the plugin to work is related to their environment. WordPress is known for having a very minimal set of requirements to get it running. I’d really want to track down and fix a lot of these weird environment issues that continue to plague the plugin. Finally, we need a <strong>really</strong> solid UI, both comment form integration and the admin side. I’m pretty happy with the new comment form integration, but the current admin screens need work. More than anything, there is just a lot of functionality in the plugin and it’s hard to boil it down. Especially when you consider both the OpenID consumer and provider options, both site-wide and per-user.</p>


<div class="related-posts"><p>Possibly related posts:</p><ul><li><a href='http://willnorris.com/2009/09/wordpress-openid-v3-3' rel='bookmark' title='Permanent Link: WordPress OpenID v3.3'>WordPress OpenID v3.3</a></li>
<li><a href='http://willnorris.com/2007/09/wordpress-openid-20-coming-soon' rel='bookmark' title='Permanent Link: WordPress OpenID 2.0 (coming soon?)'>WordPress OpenID 2.0 (coming soon?)</a></li>
<li><a href='http://willnorris.com/2008/05/changes-to-wp-openid' rel='bookmark' title='Permanent Link: Changes to wp-openid'>Changes to wp-openid</a></li>
</ul></div>]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2009/09/openid-and-wordpress-core/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>WordPress OpenID v3.3</title>
		<link>http://willnorris.com/2009/09/wordpress-openid-v3-3</link>
		<comments>http://willnorris.com/2009/09/wordpress-openid-v3-3#comments</comments>
		<pubDate>Mon, 28 Sep 2009 20:04:15 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-openid]]></category>

		<guid isPermaLink="false">http://willnorris.com/?p=876</guid>
		<description><![CDATA[I&#8217;ve finally gone ahead and released version 3.3 of the WordPress OpenID plugin.  This release includes three major sets of changes.  First, it drops support for older versions of WordPress&#8230; the minimum required version is now 2.8.  Trying to maintain backwards compatibility requires a non-trivial amount of effort, and I&#8217;d rather spend [...]

<div class="related-posts">
Possibly related posts:<ul><li><a href='http://willnorris.com/2008/10/wordpress-openid-v3' rel='bookmark' title='Permanent Link: WordPress OpenID v3.0'>WordPress OpenID v3.0</a></li>
<li><a href='http://willnorris.com/2009/09/openid-and-wordpress-core' rel='bookmark' title='Permanent Link: OpenID and WordPress Core'>OpenID and WordPress Core</a></li>
<li><a href='http://willnorris.com/2007/09/wordpress-openid-20-coming-soon' rel='bookmark' title='Permanent Link: WordPress OpenID 2.0 (coming soon?)'>WordPress OpenID 2.0 (coming soon?)</a></li>
</ul></div>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally gone ahead and released version 3.3 of the <a href="http://wordpress.org/extend/plugins/openid">WordPress OpenID plugin</a>.  This release includes three major sets of changes.  First, it drops support for older versions of WordPress&#8230; the minimum required version is now 2.8.  Trying to maintain backwards compatibility requires a non-trivial amount of effort, and I&#8217;d rather spend that time working on new features.  It also cleans up the code a fair bit, which I always like.  It also drops support for two experimental OpenID extensions known as <a href="http://eaut.org/">EAUT</a> and <a href="http://code.google.com/p/idib/">IDIB</a>.  EAUT is effectively being replaced by <a href="http://code.google.com/p/webfinger/">WebFinger</a>, and IDIB never got too much traction.  Either could still be added pretty simply by another plugin if people still want them.</p>

<p>Second, this release features a new user interface for the integrating OpenID into the WordPress comment form.  Instead of simply advertising OpenID support on the &#8220;Website&#8221; field, and <strong>always</strong> attempting OpenID authentication, the plugin now detects OpenID support for a URL, and gives the user the option to authenticate the comment.  This provides a cleaner, less obtrusive interface that should work on most all themes.  It also gives the user the option to <strong>not</strong> authentication that particular comment if they don&#8217;t want (particularly useful if you&#8217;re on a mobile device or in a hurry and don&#8217;t want to mess with OpenID).  Feel free to try it out on this post if want.  You really don&#8217;t even have to submit the comment to see it in action&#8230; just enter a valid OpenID URL for the website field, and move focus somewhere else (ie, click in the comment box like you&#8217;re going to type a comment).  There is currently no option to revert to the old style of comment form integration, so hopefully folks will like this new UI.  If you really don&#8217;t like it, you always have the option of turning off comment form integration and modifying your theme to your heart&#8217;s content.</p>

<p>Finally, this release includes a lot of minor bug fixes that people have been complaining about (sorry it took so long).  I&#8217;m sure I didn&#8217;t get to all of them, so please let me know what I missed, and I&#8217;ll try to do more regular minor releases with these smaller fixes.</p>

<p>I&#8217;ll additionally note that working on WordPress plugins is no longer part of my day job, so I currently work on them rather sporadically as I have time.  The changes in this release have been developed a few hours at a time over the last couple of months.  I&#8217;ve been running trunk here on my site for quite some time and haven&#8217;t had problems, but you never know.  Please use the <a href="http://code.google.com/p/diso/issues">DiSo issue tracker</a> to report any new bugs, or to remind me of existing tickets that are still not fixed in this release.</p>


<div class="related-posts"><p>Possibly related posts:</p><ul><li><a href='http://willnorris.com/2008/10/wordpress-openid-v3' rel='bookmark' title='Permanent Link: WordPress OpenID v3.0'>WordPress OpenID v3.0</a></li>
<li><a href='http://willnorris.com/2009/09/openid-and-wordpress-core' rel='bookmark' title='Permanent Link: OpenID and WordPress Core'>OpenID and WordPress Core</a></li>
<li><a href='http://willnorris.com/2007/09/wordpress-openid-20-coming-soon' rel='bookmark' title='Permanent Link: WordPress OpenID 2.0 (coming soon?)'>WordPress OpenID 2.0 (coming soon?)</a></li>
</ul></div>]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2009/09/wordpress-openid-v3-3/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>iTunes 9, now with more WebKit</title>
		<link>http://willnorris.com/2009/09/itunes-9-now-with-more-webkit</link>
		<comments>http://willnorris.com/2009/09/itunes-9-now-with-more-webkit#comments</comments>
		<pubDate>Wed, 09 Sep 2009 20:26:12 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://willnorris.com/?p=864</guid>
		<description><![CDATA[As John Gruber predicted yesterday, iTunes 9 certainly uses WebKit much more than the last version.  I used wireshark to do a packet trace when I clicked on the Rock Music section. Sure enough, if you gunzip the response, it is effectively standard HTML (though they do declare a custom XML namespace for everything). [...]

<div class="related-posts">
Possibly related posts:<ul><li><a href='http://willnorris.com/2005/10/nightly-webkit-builds' rel='bookmark' title='Permanent Link: Nightly WebKit builds'>Nightly WebKit builds</a></li>
<li><a href='http://willnorris.com/2006/10/comatose' rel='bookmark' title='Permanent Link: Comatose'>Comatose</a></li>
<li><a href='http://willnorris.com/2005/06/quicksilver-and-itunes' rel='bookmark' title='Permanent Link: quicksilver and itunes'>quicksilver and itunes</a></li>
</ul></div>]]></description>
			<content:encoded><![CDATA[<p>As <a href="http://daringfireball.net/2009/09/rock_and_roll_prelude">John Gruber predicted</a> yesterday, iTunes 9 certainly uses WebKit much more than the last version.  I used wireshark to do a <a href="http://files.willnorris.com/misc/iTunes9/http.txt">packet trace</a> when I clicked on the Rock Music section. Sure enough, if you gunzip the response, it is effectively standard HTML (though they do declare a custom XML namespace for everything).  It looks like this new HTML based format is triggered by the request header:</p>

<pre><code>X-Apple-Store-Front: 143441-1,5
</code></pre>

<p>For example, the following simple curl command will retrieve this Rock page:</p>

<pre><code>curl -H "X-Apple-Store-Front: 143441-1,5" \

http://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewGrouping?id=24

</code></pre>

<p>To further verify that iTunes was doing little more than rendering the result with WebKit, I went through the response HTML, fixed a couple of URLs, and got <a href="http://files.willnorris.com/misc/iTunes9/response.html">this result</a> &#8212; exactly what you see in iTunes 9.  Of course, the &#8220;Quick View&#8221; for each album doesn&#8217;t work, but you can see how it is all pieced together.</p>


<div class="related-posts"><p>Possibly related posts:</p><ul><li><a href='http://willnorris.com/2005/10/nightly-webkit-builds' rel='bookmark' title='Permanent Link: Nightly WebKit builds'>Nightly WebKit builds</a></li>
<li><a href='http://willnorris.com/2006/10/comatose' rel='bookmark' title='Permanent Link: Comatose'>Comatose</a></li>
<li><a href='http://willnorris.com/2005/06/quicksilver-and-itunes' rel='bookmark' title='Permanent Link: quicksilver and itunes'>quicksilver and itunes</a></li>
</ul></div>]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2009/09/itunes-9-now-with-more-webkit/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>A New Kind of OpenID Proxy</title>
		<link>http://willnorris.com/2009/08/a-new-kind-of-openid-proxy</link>
		<comments>http://willnorris.com/2009/08/a-new-kind-of-openid-proxy#comments</comments>
		<pubDate>Mon, 03 Aug 2009 19:21:57 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[directed identity]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://willnorris.com/?p=840</guid>
		<description><![CDATA[After writing last weeks post on directed identity, I really got to thinking on the topic a little more.  One of the things that has always bothered me about the prospect of sites requiring the use of directed identity, is that it means I can no longer use my self-hosted OpenID to login.  [...]

<div class="related-posts">
Possibly related posts:<ul><li><a href='http://willnorris.com/2009/08/best-practices-with-directed-identity' rel='bookmark' title='Permanent Link: Best Practices with Directed Identity'>Best Practices with Directed Identity</a></li>
<li><a href='http://willnorris.com/2007/03/openid-provider-wish-list' rel='bookmark' title='Permanent Link: OpenID provider wish-list'>OpenID provider wish-list</a></li>
<li><a href='http://willnorris.com/2009/07/openid-directed-identity-identifier-select' rel='bookmark' title='Permanent Link: Directed Identity vs Identifier Select'>Directed Identity vs Identifier Select</a></li>
</ul></div>]]></description>
			<content:encoded><![CDATA[<p>After writing last weeks post on <a href="http://willnorris.com/2009/08/best-practices-with-directed-identity">directed identity</a>, I really got to thinking on the topic a little more.  One of the things that has always bothered me about the prospect of sites <strong>requiring</strong> the use of directed identity, is that it means I can no longer use my self-hosted OpenID to login.  Currently, I have the <a href="http://wordpress.org/extend/plugins/openid/">WordPress OpenID plugin</a> installed, and I use it as <a href="http://willnorris.com/wordpress/index.php/openid/server">my sole OpenID provider</a>.  While the plugin does support identifier select (mainly for blogs which have multiple authors), it does not support directed identity.  But even if it did, it wouldn&#8217;t make much sense&#8230; an OpenID URL of the form &#8220;http://willnorris.com/openid/9eb4d59c1d488a4&#8221; doesn&#8217;t do a very good job of masking who it belongs to.  No matter how opaque the path, the URL is still rooted at the authority &#8220;willnorris.com&#8221; which means it can belong to only one person &#8212; me.</p>

<p>So what am I to do?  The most obvious answer is to simply use one of the larger hosted OpenID providers that support such a feature, like Google.  But I have some real problems with that, both philosophically and practically.  Fortunately, I think I may also have a better solution.</p>

<p><span id="more-840"></span></p>

<h2>Maintaining Control</h2>

<p>My first knee-jerk reaction to being forced to use an OpenID provider like Google is a purely philosophical argument.  If the whole point of OpenID was to create a completely distributed identity ecosystem, then isn&#8217;t this a huge step backwards if we&#8217;re no longer allowing for self-hosted OpenIDs in certain cases?  While I think it&#8217;s an unfortunate situation, it is a completely understandable one.  There really is no good way to maintain the privacy of the user, as I demonstrated above.  Remember that OpenID, unlike SAML, was never designed to mask the identity of the user&#8230; quite the opposite, in fact!  When you take any technology and try to apply it in situations it was not originally intended for, you have to be prepared for the reality that it&#8217;s not going to fit quite as nicely as one might like.</p>

<p>So philosophical arguments aside (as valid as they may be), what other reasons might one have for not wanting to use a third-party OpenID provider?  One of the biggest in my mind is privacy.  Have you ever looked at the &#8220;Visited Sites&#8221; page on <a href="http://myopenid.com/">MyOpenID</a> or a similar provider?  It shows which sites you&#8217;ve logged into, how many times, when the last login was, etc.  Pretty neat data to have at your disposal as a user, right?  But also potentially pretty scary data for JanRain to have for every user.  Now, I&#8217;m not suggesting that JanRain or any other OpenID provider purge this data&#8230; it&#8217;s actually a really valuable feature and I think it&#8217;s in the user&#8217;s best interest to have access to it.  But let&#8217;s remember what started this conversation&#8230; directed identity.</p>

<p><img src="http://willnorris.com/wordpress-content/uploads/2009/08/myopenid-visited-sites.png" alt="myopenid-visited-sites" title="myopenid-visited-sites" width="638" height="139" class="alignright size-full wp-image-842" style="border: 1px solid #000; padding: 1px;" /></p>

<p>While directed identity can be used for everyday logins, it really shines when maintaining user privacy becomes very important.  What if I&#8217;m a whistleblower who wants to report unsafe business practices to the government?  What if I participate in some taboo subject matter online that I want to keep hidden from family and friends.  What if I am a political dissident, and revelation of my identity could result in imprisonment or even death?  What if I simply want to exercise my constitutional right to privacy?  While some of these are rather exotic examples, they illustrate my point pretty well.  There are cases where privacy is truly important.  As I demonstrated in my last post on <a href="http://willnorris.com/2009/08/best-practices-with-directed-identity">directed identity implementations</a>, there are algorithms that can adequately protect the identity of the user from the site they are logging in to.  But remember, those algorithms do absolutely nothing for protecting my identity from my identity provider.  If privacy is my goal, then why would I trust Google or JanRain with my daily activities any more than anyone else?</p>

<p>In Andy Oram&#8217;s post on this topic &#8220;<a href="http://broadcast.oreilly.com/2009/07/shortening-cookies-using-openi.html">Shortening cookies: Using OpenID to improve government privacy online</a>&#8221; and his follow-up &#8220;<a href="http://radar.oreilly.com/2009/08/privacy-and-open-government-co.html">Privacy and open government: conversations with EPIC and others about OpenID</a>&#8221;, he talks about the possibility of the federal government running an OpenID provider which is used to authenticate users to other government websites and services.  First of all, I don&#8217;t think the government needs to stand up yet another OpenID provider.  The private sector has done a pretty good job so far of making sure people have portable identifiers, whether they actually realize it or not.  But more importantly, I simply don&#8217;t trust the government to <a href="http://www.google.com/search?q=warrantless+wiretapping">maintain and respect my privacy</a>.  In discussing whether the government is actually the right party to run this service, Oram mentions:</p>

<blockquote>
  <p>The problem is whether visitors can trust any particular server 1) to stay up, 2) not to go out of business, 3) not to leak information, 4) not to abuse the information for private gain, and 5) not to cave in to government pressure and release information outside of the scope of the law.</p>
</blockquote>

<p>It&#8217;s really the last point that bothers me.  This is a system that, by design, holds the links between the private identities of citizens, and the anonymous identifiers they are using to communicate with the government.  Not only are these individuals potentially screwed if the system is broken into, but also if some judge decides there is justifiable cause for revealing these identities.  Privacy is a matter of policy, rather than technical design.  This is not sufficient.  I think we need a system that protects user privacy as a technical feature, not simply as a policy decision.  We need a system that couldn&#8217;t reveal the identity of a user even if the Chief Justice himself were to order it.</p>

<h2>OpenID Proxy</h2>

<p>My idea for such a system is actually very simple in its design.  At a high level, it&#8217;s not unlike <a href="http://emailtoid.net/">Emailtoid</a>, JanRain&#8217;s <a href="https://rpxnow.com/">RPX</a>, or the never really launched <a href="http://vidoop.com/vidoopconnect/">Vidoop Connect</a>.  It is an OpenID proxy that stands between the actual relying party and OpenID provider, so that the two never actually communicate directly to one another.  The proxy faces both parties and therefore implements both sides of OpenID &#8212; it provides an OpenID Provider implementing directed identity which communicates with the actual relying party, and it also implements an OpenID relying party which communicates with the actual OpenID provider.  Let&#8217;s look at the basic user flow&#8230;</p>

<p>Our user, Alice, goes to OSHA.gov to report the unsafe work environments at her job.  Fearing retribution from her employer if they were to find out she reported them, Alice wants to remain anonymous in her communication with OSHA.  When logging in to OSHA&#8217;s whistleblower site, Alice enters the URL of an OpenID proxy, &#8220;proxy.example.net&#8221;.  This proxy could be run by the government itself, a private citizen&#8217;s rights organization, it doesn&#8217;t really matter.  OSHA&#8217;s OpenID relying party communicates with the OpenID Proxy&#8217;s server, and begins an identifier select OpenID flow, which results in Alice being sent over to the proxy.  Now, instead of having to create a new account at the proxy, Alice uses her real OpenID URL, &#8220;alice.example.org&#8221; to login.  After successfully authenticating, the OpenID proxy uses a hashing algorithm to generate an opaque URL for Alice, and returns that identifier back to OSHA.  So Alice was able to use her own self-hosted OpenID URL in a privacy preserving manner &#8212; OSHA has no way of identifying her based on the resulting directed identity issued by the proxy.</p>

<p>But what about the proxy itself?  As we&#8217;ve already mentioned, the OpenID provider which <strong>generates</strong> the directed identity is able to determine the user the identifier belongs to, even if a secret salt was used as part of the hashing algorithm.  In order to protect Alice&#8217;s identity from even the OpenID proxy, we need to do two more things.  Let&#8217;s look again at our hashing algorithm for generating directed identities:</p>

<pre><code>md5( username + openid_provider + relying_party + secret_salt )
</code></pre>

<p>For OpenID, that username would simply be Alice&#8217;s OpenID, &#8220;alice.example.org&#8221;.  If subpoenaed, the OpenID proxy would be able to determine whether a given directed identity indeed belonged to &#8220;alice.example.org&#8221; simply be running it through the above algorithm.  Remember that the secret salt is what prevents the relying party from using this same technique to identify the user?  Well what if we add a little secret salt of our own to the username portion of the algorithm?  What if we replaced &#8220;username&#8221; with &#8220;username + user_salt&#8221;?  That way, even the proxy itself wouldn&#8217;t be able to replay the hashing algorithm without actually knowing the correct salt value to plug in there.</p>

<p>Now, before I talk about the user salt itself, there is one caveat that must be pointed out&#8230; this is the second of the &#8220;two more things&#8221; I mentioned above.  The user salt is not exactly secret, because it must be provided to the OpenID Proxy so that it can be used to generate the directed identifier.  The thing that protects user privacy is that <strong>the proxy must not record the value of the user salt or the user OpenID</strong>.  It can&#8217;t log the values anywhere and it can&#8217;t store them in a database.  It must use the OpenID and salt to generate the directed identifier, and then get rid of them.  Otherwise, it would still be technically possible to trace the identifier back to the actual user.  This would be one reason why it might make sense for such a system to be run by a citizen&#8217;s rights organization that is generally more trusted to do everything possible to protect user privacy.  It&#8217;s also worth noting that nothing in this architecture suggests that there would be only one OpenID proxy&#8230; there can, and should, be several proxies for user&#8217;s to choose from, all using these same (or similar) techniques.</p>

<h2>Adding user salt</h2>

<p>There are two methods I can think of to add the user salt mentioned above.  The first is certainly the most straight-forward, but also a little more difficult for some users.  If Alice&#8217;s OpenID provider were to itself return a directed identity to the OpenID proxy, that would be sufficient for salting the proxy&#8217;s hashing algorithm.  So long as that directed identity is not being stored by the proxy, there would be no way to trace back any identifiers the proxy generates.  It&#8217;s worth noting that in this case, a self-hosted directed identity actually would be sufficient.  Remember earlier when I mentioned that the URL &#8220;http://willnorris.com/openid/9eb4d59c1d488a4&#8221; wouldn&#8217;t do much for protecting my identity?  That is true, but for the purposes of salting the proxy&#8217;s hashing algorithm, it would work just fine.  But this of course still requires that the user have access to an OpenID provider that supports directed identity.  The WordPress OpenID plugin which I use does not currently, so this wouldn&#8217;t work for me.</p>

<p>The second method of providing a user salt requires a slight modification to the OpenID provider, but should be a bit easier to do.  The salt could be provided separately by the OpenID provider as an extension on the OpenID transaction itself.  To make things easier, it could simply be a new Attribute Exchange attribute.  No need for new OpenID extensions, just a new attribute which represents a &#8220;user salt&#8221;.  The OpenID proxy would then combine the user&#8217;s OpenID together with the salt value, and use that to generate the final directed identity that is returned to the relying party.  If the proxy were subpoenaed to verify if a given directed identifier belonged to &#8220;alice.example.org&#8221;, it would be unable to do so without also knowing the user salt.  And as long as the salt was not being recorded anywhere, the proxy would be completely incapable of verifying the user that an opaque identifier belonged to.</p>

<p>So what about using some other things as the user salt?  How about the association used in the OpenID transaction?  Remember that the point is still for Alice to be able to login to OSHA.gov over time and be recognized as the same (possibly anonymous) user.  In order for this to work, she must return with the same directed identifier from the OpenID proxy each time.  And in order for the proxy to ensure that it generates the same directed identifier, it must use the same input values.  While an OpenID association <strong>is</strong> intended to be relatively long-lived, it can, and often does, change over time.  When this happens, the proxy would end up generating a new directed identifier for Alice, and she would no longer appear as the same user at OSHA.gov.</p>

<h2>Some practical matters</h2>

<p>So there are some additional practical matters that I think must be considered for this solution to truly work.  First of all, <em>what happens if the proxy&#8217;s secret salt is compromised?</em>  This would certainly be a bad thing, but not quite as bad as it would be in a standard directed identity situation.  Remember in our final algorithm from <a href="http://willnorris.com/2009/08/best-practices-with-directed-identity">last time</a>, the secret salt was the one and only key that protected the privacy of the user in a generated directed identifier.  If the salt is compromised by a party, they could then brute-force the hashing algorithm and identify the true identity of a user associated with a directed identifier.  But remember that one of the goals of the proxy is to protect the true identity of the user from even the proxy itself&#8230; that&#8217;s why we added the user salt.  So even if the secret salt of the proxy were compromised, an attacker would be unable to identify the user associated with a given directed identifier.  Additionally, if the proxy were aware of the compromised salt, they could transition over to a new secret salt using the same method I mentioned last time that USC uses to update relying parties of new USCID values.  The proxy would simply inform the relying party that user X, identified by this opaque identifier, was previously identified by this other opaque identifier, and their records should be updated.  Nothing about the user herself is revealed, only the transition from one opaque identifier to another.</p>

<p><em>What if the user still wants to maintain different personas for different relying parties?</em>  For example, what if Alice wants to reveal the name of her employer via an AX attribute when communicating with OSHA.gov, but not when communicating with WhiteHouse.gov?  Technically, the solution is pretty simple, but it&#8217;s not as user friendly as I would like.  The OpenID proxy would simply need to embed the trust root of the <strong>actual</strong> relying party inside its own trust root that it presents to Alice&#8217;s OpenID Provider.  Part of the OpenID flow is that a provider prompts the user if they trust the site that is asking them to authenticate, and additionally if they want to release any additional attributes to the party.  The relying party is identified using a URL known as the &#8220;trust root&#8221;.  So a user may see a prompt (borrowing from MyOpenID&#8217;s language) along the lines of:</p>

<blockquote>
  <p>You are signing in to <strong>proxy.example.net/</strong> as <strong>http://alice.example.org/</strong>.</p>
</blockquote>

<p>Traditionally, the decision that Alice makes here is recorded so that she is not prompted each time she logs in.  So if she wants to make a different decision depending on which site she is logging in to, then the OpenID proxy would need to change its trust root.  One example might result in a prompt that looks like:</p>

<blockquote>
  <p>You are signing in to <strong>proxy.example.net/site/osha.gov</strong> as <strong>http://alice.example.org/</strong>.</p>
</blockquote>

<p>This would record her decision specifically for &#8220;OSHA.gov via proxy.example.net&#8221;.  Using this method, she could easily release different attributes for different relying parties, without any changes to her OpenID provider whatsoever.  While I don&#8217;t like the idea of the user having to parse apart that URL to figure out what it means, it&#8217;s at least workable.  As a long term solution, a new OpenID extension could be defined which provides a more human friendly version of the trust root which explains to the user more clearly where her data is going.  In fact, I think that has already been proposed and being worked on.</p>

<h2>Proof of concept</h2>

<p>Though the explanation of the concept ends up being a little wordy, the design itself is actually quite simple.  Because of the strict requirement that identifiers <strong>not</strong> be stored, there is actually not much to it.  The only database storage would be for OpenID associations and nonces&#8230; everything else is calculated in real time.  I&#8217;ll be working with <a href="http://mtrichardson.com/">Michael Richardson</a> this week to be build a working implementation to show how it would work.  I&#8217;m also beginning conversations with <a href="http://epic.org/">EPIC</a> to help advise them on their recommendations to OMB regarding federal website cookie policies.  I welcome any questions or comments on this approach to privacy with OpenID.  Some of the specifics I just really thought about this last weekend, so I may be overlooking a few things.  But the overall architecture is nothing that hasn&#8217;t been done before, and has a strong, proven track record.</p>


<div class="related-posts"><p>Possibly related posts:</p><ul><li><a href='http://willnorris.com/2009/08/best-practices-with-directed-identity' rel='bookmark' title='Permanent Link: Best Practices with Directed Identity'>Best Practices with Directed Identity</a></li>
<li><a href='http://willnorris.com/2007/03/openid-provider-wish-list' rel='bookmark' title='Permanent Link: OpenID provider wish-list'>OpenID provider wish-list</a></li>
<li><a href='http://willnorris.com/2009/07/openid-directed-identity-identifier-select' rel='bookmark' title='Permanent Link: Directed Identity vs Identifier Select'>Directed Identity vs Identifier Select</a></li>
</ul></div>]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2009/08/a-new-kind-of-openid-proxy/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Best Practices with Directed Identity</title>
		<link>http://willnorris.com/2009/08/best-practices-with-directed-identity</link>
		<comments>http://willnorris.com/2009/08/best-practices-with-directed-identity#comments</comments>
		<pubDate>Mon, 03 Aug 2009 00:27:43 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[directed identity]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[saml]]></category>
		<category><![CDATA[shibboleth]]></category>

		<guid isPermaLink="false">http://willnorris.com/?p=831</guid>
		<description><![CDATA[Given the current discussion happening right now around federal website cookie policies, and the good response I got from my last post, I wanted to continue talking about directed identity a little bit.  In this post, I want to talk about how directed identity has actually been implemented in projects I&#8217;ve been involved with, [...]

<div class="related-posts">
Possibly related posts:<ul><li><a href='http://willnorris.com/2009/07/openid-directed-identity-identifier-select' rel='bookmark' title='Permanent Link: Directed Identity vs Identifier Select'>Directed Identity vs Identifier Select</a></li>
<li><a href='http://willnorris.com/2009/08/a-new-kind-of-openid-proxy' rel='bookmark' title='Permanent Link: A New Kind of OpenID Proxy'>A New Kind of OpenID Proxy</a></li>
<li><a href='http://willnorris.com/2007/03/openid-provider-wish-list' rel='bookmark' title='Permanent Link: OpenID provider wish-list'>OpenID provider wish-list</a></li>
</ul></div>]]></description>
			<content:encoded><![CDATA[<p>Given the current discussion happening right now around federal website <a href="http://blog.ostp.gov/2009/07/24/cookiepolicy/">cookie policies</a>, and the good response I got from my <a href="http://willnorris.com/2009/07/openid-directed-identity-identifier-select">last post</a>, I wanted to continue talking about directed identity a little bit.  In this post, I want to talk about how directed identity has actually been implemented in projects I&#8217;ve been involved with, and what lessons can be learned from that.</p>

<p><span id="more-831"></span></p>

<h2>Shibboleth and SAML</h2>

<p><a href="http://shibboleth.internet2.edu/">Shibboleth</a> is an open source web single sign-on product which is very popular with universities around the world.  It is primarily an implementation of the <a href="http://saml.xml.org/saml-specifications">Security Assertion Markup Language</a> (SAML), but supports other identity protocols as well.  SAML v2 defines a specific type of identifier that may be used to identify a user within a transaction known as a <em>Persistent Identifier</em>.  The name itself does not convey it&#8217;s full meaning, but it is defined as &#8220;a persistent opaque identifier for a principal that is specific to an identity provider and a service provider or affiliation of service providers.&#8221;  This is SAML&#8217;s <em>directed identity</em>.</p>

<p>Shibboleth&#8217;s implementation of persistent identifiers has matured a bit over the years, but the main algorithm remains the same.  At it&#8217;s simplest, the identifier is simply a hash of three things: an identifier for the user, an identifier for the identity provider, and an identifier for the relying party.  Using md5 as our hashing algorithm, and using a few made up values, this would look like:</p>

<pre><code>md5( "jsmith" + "http://idp.example.com/" + "http://sp.example.com/" ) = 
    2f6bc52c7527747eff263f4183c7f402
</code></pre>

<p>When a relying party receives the string &#8220;2f6bc52c7527747eff263f4183c7f402&#8221;, it is completely opaque and reveals nothing about the identity of the user.</p>

<h2>Working with known algorithms</h2>

<p>As I mentioned before, Shibboleth is open source software.  All of our code is publicly available, including <a href="http://svn.middleware.georgetown.edu/view/java-shib-common/branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/resolver/provider/attributeDefinition/TransientIdAttributeDefinition.java?view=markup">the way that we calculate persistent identifiers</a>.  So how could a relying party use this knowledge to take the above opaque identifier and decipher the identity of the user it belongs to?  Pretty simply, if they have a list of possible usernames, or can reasonably guess them.  A list of usernames is far easier to get than you might imagine from unprotected university LDAP directories.  Then you simply iterate through the list and run the same algorithm until you find the matching hash value.  And even given a population of 30,000 usernames (the approximate number of students at <a href="http://www.usc.edu/">USC</a> where I worked), the following shell script churns through them in about 90 seconds:</p>

<pre><code>~$ date &amp;&amp; for i in `head -n 30000 /usr/share/dict/web2`; 
   do echo $i | md5 &gt;/dev/null; done &amp;&amp; date
Sun Aug  2 16:25:53 PDT 2009
Sun Aug  2 16:27:35 PDT 2009
</code></pre>

<p>To protect against such a brute-force attach to reveal the identity of a user, we added a secret salt to the hashing algorithm.  That way, you can&#8217;t regenerate the hash without also knowing the salt value:</p>

<pre><code>md5( "jsmith" + "http://idp.example.com/" + "http://sp.example.com/" 
    + "my-secret-salt" ) = cf79282c587897fb733d8338fe7bc9c2
</code></pre>

<p>It&#8217;s worth pointing out that, while use of a secret salt prevents a relying party from brute forcing the hash, it in no way prevents the identity provider from doing so, since they do of course know the secret salt.  Though we never ended up needing to do this at USC, we built the tools that would enable us to identify the user a persistent identifier belonged to.  In the event that a relying party reported that a particular user was abusing their system, we wanted to make sure we could identify who it was.</p>

<h2>The realities of deployment</h2>

<p>The above algorithm actually works pretty well for generating unique and secure opaque values for tuples of user, identity provider, and service provider.  But what happens when one of those values change?  At USC, users could request that their username be changed for a variety of reasons, and approximately 300 such requests were made each year.  So using the above algorithm, a username change would change every one of the user&#8217;s generated persistent identifiers.  And the reality is, businesses are often bought out by other businesses.  What happens when &#8220;http://sp.example.com/&#8221; needs to change to &#8220;http://sp.new-company.com/&#8221;?  That will effect the generated persistent identifier for <strong>every</strong> user.  How do you deal with these realities?  There are a number of ways, and I&#8217;ll outline just a few.  There is no one <em>right</em> solution, as the policy and practices of a particular institution will greatly impact their decision of how to address these situations.</p>

<p>Perhaps the simplest option in some respects would be to simply not change which identifiers are used for generating the hash and instead <strong>map the new identifiers</strong> to the old values.  Even if a user&#8217;s username has changed to &#8220;jjones&#8221;, you map it back to &#8220;jsmith&#8221; for the purposes of generated persistent identifiers.  While this allows a deployment to continue using the same hashes, it does introduce the burden of maintaining this map of identifiers.  And what is the institution&#8217;s policy with regards to re-issuing identifiers?  If &#8220;jsmith&#8221; is allowed to be re-issued to a different user at some point in the future, that is going to create problems.</p>

<p>An alternate solution would be to simply <strong>use better identifiers</strong>.  At USC, we had another user attribute called the &#8220;uscPVID&#8221; which we used instead of username.  This was itself an opaque identifier that effectively served as the primary key within the enterprise directory.  Even if all the other data for a user changed like their name and username, the uscPVID would remain the same.  The same kind of persistent key can be obtained for relying parties by creating a lookup table that maps the relying party&#8217;s public ID to some more persistent internal ID.  If and when a relying party changes their public ID, you simply modify, or add a new entry in your lookup table.</p>

<p>Finally, an identity provider could <strong>migrate from old to new identifiers</strong>, either with a one time update, or gradually.  For a one time update, the identity provider would generate the old and new identifier for a user or set of users, and provide that information to the relying part out of band.  The relying party would then be responsible for updating their database accordingly.  Alternately, the new and old mapping could be provided gradually at the time of user login by using attributes.  This was the technique used at USC for updating relying parties of changes to a different user attribute known as the USCID.  For reasons I won&#8217;t bother explaining here, this 10 digit ID could change for a user when certain events occurred.  To alert relying parties, we would include two attributes &#8212; the current USCID for the user, along with a list of &#8220;historical&#8221; USCIDs for that user.  Relying parties were then responsible for updating any records they had for one of the historical USCIDs to the current USCID of the user.</p>

<h2>Application to OpenID</h2>

<p>The above hashing method could be used with little or no modification to create directed identity URLs for OpenID users.  You could of course simply generate completely random IDs and store them in the database&#8230; that works too.  In my next post however, I&#8217;ll be talking about a new kind of OpenID service I&#8217;ve been doing a lot of thinking about, an OpenID proxy which works to protect the privacy of OpenIDs that don&#8217;t support directed identity themselves.  We&#8217;ll be using the above hashing algorithm, but doing some interesting things with the user identifier.</p>


<div class="related-posts"><p>Possibly related posts:</p><ul><li><a href='http://willnorris.com/2009/07/openid-directed-identity-identifier-select' rel='bookmark' title='Permanent Link: Directed Identity vs Identifier Select'>Directed Identity vs Identifier Select</a></li>
<li><a href='http://willnorris.com/2009/08/a-new-kind-of-openid-proxy' rel='bookmark' title='Permanent Link: A New Kind of OpenID Proxy'>A New Kind of OpenID Proxy</a></li>
<li><a href='http://willnorris.com/2007/03/openid-provider-wish-list' rel='bookmark' title='Permanent Link: OpenID provider wish-list'>OpenID provider wish-list</a></li>
</ul></div>]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2009/08/best-practices-with-directed-identity/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
	</channel>
</rss>
