<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>SteverB</title>
    <description>Things I felt like posting.</description>
    <link>http://steverb.com/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 2.5.0.6</generator>
    <language>en-GB</language>
    <blogChannel:blogRoll>http://steverb.com/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>My name</dc:creator>
    <dc:title>SteverB</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SteverB" /><feedburner:info uri="steverb" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>Moved</title>
      <description>&lt;p&gt;Hopefully you only noticed because things started working again.&amp;nbsp;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SteverB/~4/W0meBvTHzvU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/SteverB/~3/W0meBvTHzvU/post.aspx</link>
      <comments>http://steverb.com/post/2011/11/03/Moved.aspx#comment</comments>
      <guid isPermaLink="false">http://steverb.com/post.aspx?id=97cd2e65-01e4-4434-b36a-159d421ec036</guid>
      <pubDate>Thu, 03 Nov 2011 09:11:00 -1200</pubDate>
      <dc:publisher>SteverB</dc:publisher>
      <pingback:server>http://steverb.com/pingback.axd</pingback:server>
      <pingback:target>http://steverb.com/post.aspx?id=97cd2e65-01e4-4434-b36a-159d421ec036</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://steverb.com/trackback.axd?id=97cd2e65-01e4-4434-b36a-159d421ec036</trackback:ping>
      <wfw:comment>http://steverb.com/post/2011/11/03/Moved.aspx#comment</wfw:comment>
      <wfw:commentRss>http://steverb.com/syndication.axd?post=97cd2e65-01e4-4434-b36a-159d421ec036</wfw:commentRss>
    <feedburner:origLink>http://steverb.com/post.aspx?id=97cd2e65-01e4-4434-b36a-159d421ec036</feedburner:origLink></item>
    <item>
      <title>OAuth Presentation</title>
      <description>&lt;p&gt;I finally got off my duff and presented to the local .NET user's group tonight. I think it went well, but my timing was a little fast.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In case you missed something, here are the slides:&amp;nbsp;&lt;a href="http://steverb.com/file.axd?file=2010%2f7%2fOAUTH.pdf"&gt;http://steverb.com/file.axd?file=2010%2f7%2fOAUTH.pdf&lt;/a&gt; and if you have any questions, feel free to shoot me an &lt;a href="mailto:me@steverb.com"&gt;email&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SteverB/~4/8JzhIQDFPtQ" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/SteverB/~3/8JzhIQDFPtQ/post.aspx</link>
      <comments>http://steverb.com/post/2010/07/27/OAuth-Presentation.aspx#comment</comments>
      <guid isPermaLink="false">http://steverb.com/post.aspx?id=710ebc72-9ea5-4527-9fac-659adaaaec16</guid>
      <pubDate>Tue, 27 Jul 2010 15:41:00 -1200</pubDate>
      <dc:publisher>Admin</dc:publisher>
      <pingback:server>http://steverb.com/pingback.axd</pingback:server>
      <pingback:target>http://steverb.com/post.aspx?id=710ebc72-9ea5-4527-9fac-659adaaaec16</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://steverb.com/trackback.axd?id=710ebc72-9ea5-4527-9fac-659adaaaec16</trackback:ping>
      <wfw:comment>http://steverb.com/post/2010/07/27/OAuth-Presentation.aspx#comment</wfw:comment>
      <wfw:commentRss>http://steverb.com/syndication.axd?post=710ebc72-9ea5-4527-9fac-659adaaaec16</wfw:commentRss>
    <feedburner:origLink>http://steverb.com/post.aspx?id=710ebc72-9ea5-4527-9fac-659adaaaec16</feedburner:origLink></item>
    <item>
      <title>Fun With OAuth – Part 2</title>
      <description>&lt;p&gt;Now that we have a clue about &lt;a href="http://steverb.com/post/2010/03/13/Fun-With-OAuth.aspx"&gt;calling an OAuth secured service using Javascript&lt;/a&gt;, let’s try it again with C#. That way we can do the calling from the server side and not have to worry about exposing our secret key to the browser. This example is using the OAuth libray found at: &lt;a title="http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs" href="http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs"&gt;http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs&lt;/a&gt;.  There are other, more full featured C# OAuth libraries available (&lt;a title="http://code.google.com/p/oauth-dot-net/" href="http://code.google.com/p/oauth-dot-net/"&gt;http://code.google.com/p/oauth-dot-net/&lt;/a&gt; for instance), I like this one because it’s simple and I can grok everything it’s doing.&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;OAuthBase oAuth = &lt;span class="kwrd"&gt;new&lt;/span&gt; OAuthBase();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt; &lt;span class="rem"&gt;//gather all the values we'll need for the header and signature&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; nonce = oAuth.GenerateNonce();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; timestamp = oAuth.GenerateTimeStamp();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; key = KEY;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; secret = SECRET;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;Uri url = &lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;&amp;quot;http://www.steverb.com&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; normedURL = &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; requestParams = &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&lt;span class="rem"&gt;//generate signature&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; sig = oAuth.GenerateSignature(url, key, secret, &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;GET&amp;quot;&lt;/span&gt;, timestamp, nonce, &lt;span class="kwrd"&gt;out&lt;/span&gt; normedURL, &lt;span class="kwrd"&gt;out&lt;/span&gt; requestParams);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;&lt;span class="rem"&gt;//url encode the signature&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;sig = HttpUtility.UrlEncode(sig);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;&lt;span class="rem"&gt;//build the header string using the previously defined values&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;StringBuilder sb = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringBuilder(&lt;span class="str"&gt;&amp;quot;OAuth realm=\&amp;quot;\&amp;quot;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;,oauth_consumer_key=\&amp;quot;{0}\&amp;quot;&amp;quot;&lt;/span&gt;, key);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;,oauth_nonce=\&amp;quot;{0}\&amp;quot;&amp;quot;&lt;/span&gt;, nonce);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;,oauth_timestamp=\&amp;quot;{0}\&amp;quot;&amp;quot;&lt;/span&gt;, timestamp);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;,oauth_signature_method=\&amp;quot;{0}\&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;HMAC-SHA1&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;,oauth_version=\&amp;quot;{0}\&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;,oauth_signature=\&amp;quot;{0}\&amp;quot;&amp;quot;&lt;/span&gt;, sig);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; header = sb.ToString();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;&lt;span class="rem"&gt;//add the header to our web request&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;client.Headers[HttpRequestHeader.Authorization] = header;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;br /&gt;

&lt;p&gt;Not too bad, and it’s almost as simple on the service side. Basically, the service will pull the non-encrypted data out of the header, check and make sure that the nonce hasn’t already been used, and encrypt the whole thing with the secret key that both the client and service know about.&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="rem"&gt;//first grab the header out of the http request&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; header = WebOperationContext.Current.IncomingRequest.Headers[HttpRequestHeader.Authorization];&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;OAuthBase oAuth = &lt;span class="kwrd"&gt;new&lt;/span&gt; OAuthBase();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;Dictionary&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;, &lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; OAuthValues = &lt;span class="kwrd"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;, &lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt;();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="rem"&gt;//remove the leading &amp;quot;OAuth&amp;quot; from the header...pesky&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; AuthHeader = Regex.Replace(OAuthHeader, &lt;span class="str"&gt;&amp;quot;OAuth&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt;[] Headers = AuthHeader.Split(&lt;span class="str"&gt;','&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&lt;span class="rem"&gt;//add each of the values in the header to our dictionary&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;&lt;span class="kwrd"&gt;foreach&lt;/span&gt; (&lt;span class="kwrd"&gt;string&lt;/span&gt; entry &lt;span class="kwrd"&gt;in&lt;/span&gt; Headers)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt; m_entry = entry.Trim().TrimEnd(&lt;span class="str"&gt;'&amp;quot;'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt;[] values = Regex.Split(m_entry, &lt;span class="str"&gt;&amp;quot;=\&amp;quot;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (values.Count() &amp;gt; 1)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        OAuthValues.Add(values[0].Trim(), values[1].Trim().TrimEnd(&lt;span class="str"&gt;'&amp;quot;'&lt;/span&gt;));&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;}&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;&lt;span class="rem"&gt;//grab the values out of our dictionary for the signature method&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; nonce = OAuthValues[&lt;span class="str"&gt;&amp;quot;oauth_nonce&amp;quot;&lt;/span&gt;] ?? &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; timestamp = OAuthValues[&lt;span class="str"&gt;&amp;quot;oauth_timestamp&amp;quot;&lt;/span&gt;] ?? &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; key = KEY;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; secret = SECRET;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;Uri url = &lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;&amp;quot;http://www.steverb.com&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; normedURL = &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; requestParams = &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;&lt;span class="rem"&gt;//generate a signature&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; sig = oAuth.GenerateSignature(url, key, secret, &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;GET&amp;quot;&lt;/span&gt;, timestamp, nonce, &lt;span class="kwrd"&gt;out&lt;/span&gt; normedURL, &lt;span class="kwrd"&gt;out&lt;/span&gt; requestParams);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;&lt;span class="rem"&gt;//compare it to the signature in the header&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (sig != OAuthValues[&lt;span class="str"&gt;&amp;quot;oauth_signature&amp;quot;&lt;/span&gt;])&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;}&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;&lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;
  &lt;br /&gt;Tada! As long as the encrypted signature matches then the OAuth is good. A quick point, for a real implementation we would really want to check and make sure that the nonce had not been used before and that the timestamp on the message was fairly recent (in order to prevent replay attacks).&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SteverB/~4/_acgLfKbu5w" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/SteverB/~3/_acgLfKbu5w/post.aspx</link>
      <comments>http://steverb.com/post/2010/05/25/Fun-With-OAuth-e28093-Part-2.aspx#comment</comments>
      <guid isPermaLink="false">http://steverb.com/post.aspx?id=062d544a-e596-4d69-a2ba-5d5d9840d53d</guid>
      <pubDate>Tue, 25 May 2010 17:03:00 -1200</pubDate>
      <category>C#</category>
      <category>Code</category>
      <category>Oauth</category>
      <dc:publisher>Stever B</dc:publisher>
      <pingback:server>http://steverb.com/pingback.axd</pingback:server>
      <pingback:target>http://steverb.com/post.aspx?id=062d544a-e596-4d69-a2ba-5d5d9840d53d</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://steverb.com/trackback.axd?id=062d544a-e596-4d69-a2ba-5d5d9840d53d</trackback:ping>
      <wfw:comment>http://steverb.com/post/2010/05/25/Fun-With-OAuth-e28093-Part-2.aspx#comment</wfw:comment>
      <wfw:commentRss>http://steverb.com/syndication.axd?post=062d544a-e596-4d69-a2ba-5d5d9840d53d</wfw:commentRss>
    <feedburner:origLink>http://steverb.com/post.aspx?id=062d544a-e596-4d69-a2ba-5d5d9840d53d</feedburner:origLink></item>
    <item>
      <title>The Problem With MVPs</title>
      <description>&lt;p&gt;The other day I had the chance to peruse the work of another developer, a Microsoft MVP. The code was less than impressive. To be frank, it stunk, but it stunk in a strange way. It had a weird combination of advanced technique and rank naivet&amp;eacute;. There was separation of concerns, but it was much more convoluted than it needed to be. The work that the code performed was relatively trivial, but it was hidden behind a bag of patterns and the structure of the classes made finding the code that did the real work an exercise in spelunking.&lt;/p&gt;
&lt;p&gt;I mentioned it to a friend of mine, and he shared his story about a hiring interview with an MVP carrying job candidate. The story was eerily similar. The candidate was well versed with the latest and greatest development methodologies, but seemed to lack a grasp of writing a simple &amp;ldquo;&lt;a href="http://en.wikipedia.org/wiki/Bizz_buzz"&gt;fizz-buzz&lt;/a&gt;&amp;rdquo;. To make matters worse, part-way through the interview the candidate starting listing their &amp;ldquo;requirements&amp;rdquo;, which conferences they&amp;rsquo;d be attending, which technologies they would use, etc.&lt;/p&gt;
&lt;p&gt;I was flabbergasted. Granted, my friend was glad the candidate was so forthcoming with his lack of professionalism. It helped make his decision not to hire the guy much easier. After I thought about it a little bit more, I realized that the fault wasn&amp;rsquo;t totally with the MVPs in question. All of us share a little of the blame.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h4&gt;What&amp;rsquo;s All This MVP Stuff?&lt;/h4&gt;
&lt;p&gt;Microsoft&amp;rsquo;s Most Valuable Professional program recognizes professionals who share their knowledge of MS products with others. It&amp;rsquo;s a great deal for Microsoft and it&amp;rsquo;s a pretty good deal for the MVPs. Microsoft gets free technical support for their products and the MVPs get public recognition of their contributions to the community at large. The problem with the MVP program is what it doesn&amp;rsquo;t recognize. The MVP program does not recognize technical ability. It&amp;rsquo;s possible to be awarded an MVP in a development related area and not really be able to write code.&lt;/p&gt;
&lt;p&gt;If you want an MVP award , you blog, you answer questions on the Microsoft forums and on &lt;a href="http://stackoverflow.com"&gt;StackOverflow&lt;/a&gt;. You talk a lot. Mind you, there&amp;rsquo;s nothing wrong with doing any of those things and a lot of reasons why we should encourage the behavior. Heck, I do those things.&amp;nbsp; But you can do all of that without ever writing code beyond the level of a &amp;ldquo;hello world&amp;rdquo; presentation demo. You can do all of those things without knowing how to do anything but use a search engine, cut and paste and tirelessly self-promote.&lt;/p&gt;
&lt;p&gt;If you compare the Microsoft and the Open Source communities, there is a striking contrast. If you want attention in the open source community you write code and you release some projects. You do stuff. If you want attention in the Microsoft community you talk.&lt;/p&gt;
&lt;h4&gt;How Is This My Fault?&lt;/h4&gt;
&lt;p&gt;Even with all of that, there isn&amp;rsquo;t really a problem with the MVP program. It&amp;rsquo;s working precisely the way Microsoft wants and needs it to. Microsoft gets free advertisement for its products and a never ending supply of people to offer handholding for users of its platforms. There&amp;rsquo;s really no reason for Microsoft to change things on their end, although it would be nice if Microsoft distinctly recognized developers that actually released more than hot air.&lt;/p&gt;
&lt;p&gt;What we really need to fix are our expectations and perceptions of those that have been awarded an MVP. They might be great developers; I know some that are. They might be completely clueless; there are obviously a few in this category as well. The fact that a person has an MVP award doesn&amp;rsquo;t really tell us what kind of developer they are. The only thing we can know for sure is that they know how to answer questions on the internet and (depending on the MVP) give a pretty good semi-technical talk. Beyond that, we need to evaluate MVPs just as we would any other developer.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SteverB/~4/dkP8WdNATXA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/SteverB/~3/dkP8WdNATXA/post.aspx</link>
      <comments>http://steverb.com/post/2010/03/24/The-Problem-With-MVPs.aspx#comment</comments>
      <guid isPermaLink="false">http://steverb.com/post.aspx?id=65e19e27-8e65-4c41-8311-868393cec797</guid>
      <pubDate>Wed, 24 Mar 2010 16:24:00 -1200</pubDate>
      <dc:publisher>Stever B</dc:publisher>
      <pingback:server>http://steverb.com/pingback.axd</pingback:server>
      <pingback:target>http://steverb.com/post.aspx?id=65e19e27-8e65-4c41-8311-868393cec797</pingback:target>
      <slash:comments>28</slash:comments>
      <trackback:ping>http://steverb.com/trackback.axd?id=65e19e27-8e65-4c41-8311-868393cec797</trackback:ping>
      <wfw:comment>http://steverb.com/post/2010/03/24/The-Problem-With-MVPs.aspx#comment</wfw:comment>
      <wfw:commentRss>http://steverb.com/syndication.axd?post=65e19e27-8e65-4c41-8311-868393cec797</wfw:commentRss>
    <feedburner:origLink>http://steverb.com/post.aspx?id=65e19e27-8e65-4c41-8311-868393cec797</feedburner:origLink></item>
    <item>
      <title>Fun With OAuth - Part 1</title>
      <description>&lt;p&gt;We’ve been working on implementing some sort of enterprise wide single sign-on (SSO) at work. As part of that we really needed some way to authenticate with web services &lt;em&gt;without&lt;/em&gt; depending on Windows or Basic Authentication, which is a phenomenal pain in the butt.&lt;/p&gt;
&lt;h4&gt;Enter OAuth&lt;/h4&gt;
&lt;p&gt;OAuth is “An open protocol to allow secure API authorization in a simple and standard method from desktop and web applications.” In other words, you can authenticate with it from lots of different places. &lt;/p&gt;
&lt;p&gt;The way full blown OAuth works is that you use an application that wants to access your data that resides in another service or application. The application wanting the data sends you to the authentication site for the service that has your data. You login, and then tell the service that you will allow the app to access your data. The service sends you back to the application with a request key. The application sends the request key to the service and the service sends the application an access key.&lt;/p&gt;
&lt;p&gt;Once all that handshaking is done, the application takes the consumer secret and the consumer key (that the application already had) along with the recently obtained access key and a few other relevant pieces of info (timestamp, nonce, etc) and hashes them all together. The application then takes all this information and creates an OAuth header that it sends with any service requests. The service then uses the information in the header to identify the application acting on behalf of the user.&lt;/p&gt;
&lt;p&gt;It sounds complicated because it kinda is, but once you’ve run through it a few times it starts to make sense. I suggest you read &lt;a href="http://hueniverse.com/oauth/"&gt;The Beginner’s Guide to OAuth&lt;/a&gt; to get a thorough understanding.&lt;/p&gt;
&lt;h4&gt;Why would you do this to yourself?&lt;/h4&gt;
&lt;p&gt;The really nice thing about OAuth is that it works on a lot of platforms. There are &lt;a href="http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs"&gt;implementations in C#,&lt;/a&gt; there are &lt;a href="http://oauth.googlecode.com/svn/code/ruby/"&gt;implementations in Ruby&lt;/a&gt;, there are &lt;a href="http://oauth.googlecode.com/svn/code/javascript/"&gt;implementations in Javascript&lt;/a&gt;. Awesome. So let’s use it.&lt;/p&gt;
&lt;p&gt;Here, have some Javascript:&lt;/p&gt;
&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.91%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; height: 100%; max-height: 800px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; getHello(mToken, mWord)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;    &lt;span style="color: #008000"&gt;//create the message portion&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; message = {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         method: &lt;span style="color: #006080"&gt;"GET"&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         action: url,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         parameters: {oauth_version: &lt;span style="color: #006080"&gt;"1.0"&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         oauth_consumer_key: &lt;span style="color: #006080"&gt;"myservicekey"&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;         oauth_timestamp: OAuth.timestamp(),&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;         oauth_nonce: OAuth.nonce(11),&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         oauth_signature_method: &lt;span style="color: #006080"&gt;"HMAC-SHA1"&lt;/span&gt;                        &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;     };&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;     &lt;span style="color: #008000"&gt;//create the accessor portion   &lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; accessor = {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;         consumerSecret: &lt;span style="color: #006080"&gt;"myappssecretkey"&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;         tokenSecret: &lt;span style="color: #006080"&gt;"theSecretIGoFromTheUserSigningIn"&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;     };&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;     &lt;span style="color: #008000"&gt;//sign the OAuth message&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;     OAuth.SignatureMethod.sign(message, accessor);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;     &lt;span style="color: #008000"&gt;//generate the entire header (with signature included)&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; authorizationHeader = OAuth.getAuthorizationHeader(&lt;span style="color: #006080"&gt;""&lt;/span&gt;, message.parameters);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;     &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;     &lt;span style="color: #008000"&gt;//make the ajax call&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;     $.ajax(&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;         &lt;span style="color: #008000"&gt;//set the OAuth authorization header before we send the web request&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;         beforeSend: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt;(req) &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;             req.setRequestHeader(&lt;span style="color: #006080"&gt;"Authorization"&lt;/span&gt;, authorizationHeader);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;          },&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;          type: &lt;span style="color: #006080"&gt;"GET"&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;          url: &lt;span style="color: #006080"&gt;"http://myservice.com/Hello?World="&lt;/span&gt; + mWord,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;          contentType: &lt;span style="color: #006080"&gt;"text/plain; charset=utf-8"&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  39:&lt;/span&gt;          dataType: &lt;span style="color: #006080"&gt;"text"&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  40:&lt;/span&gt;          success: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt;(data) {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  41:&lt;/span&gt;              $(&lt;span style="color: #006080"&gt;"#ingest_history"&lt;/span&gt;).html(&lt;span style="color: #006080"&gt;"The REST Service said: "&lt;/span&gt; + data);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  42:&lt;/span&gt;          }&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  43:&lt;/span&gt;     });&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  44:&lt;/span&gt; }&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  45:&lt;/span&gt;        &lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;br&gt;Here we have an example of calling a web service with OAuth. Now, what’s the service going to do with it?&lt;/p&gt;
&lt;p&gt;The service is going to do the same thing. It’s going to take the publicly readable information in the header, and combine that with the secrets that it knows and make sure they match. I’ll post the code to do that next time.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SteverB/~4/BAqSNPbJwmk" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/SteverB/~3/BAqSNPbJwmk/post.aspx</link>
      <comments>http://steverb.com/post/2010/03/13/Fun-With-OAuth.aspx#comment</comments>
      <guid isPermaLink="false">http://steverb.com/post.aspx?id=c1617582-399d-4e55-ad81-6bd691462157</guid>
      <pubDate>Sat, 13 Mar 2010 17:48:00 -1200</pubDate>
      <category>Code</category>
      <category>Oauth</category>
      <dc:publisher>Stever B</dc:publisher>
      <pingback:server>http://steverb.com/pingback.axd</pingback:server>
      <pingback:target>http://steverb.com/post.aspx?id=c1617582-399d-4e55-ad81-6bd691462157</pingback:target>
      <slash:comments>8</slash:comments>
      <trackback:ping>http://steverb.com/trackback.axd?id=c1617582-399d-4e55-ad81-6bd691462157</trackback:ping>
      <wfw:comment>http://steverb.com/post/2010/03/13/Fun-With-OAuth.aspx#comment</wfw:comment>
      <wfw:commentRss>http://steverb.com/syndication.axd?post=c1617582-399d-4e55-ad81-6bd691462157</wfw:commentRss>
    <feedburner:origLink>http://steverb.com/post.aspx?id=c1617582-399d-4e55-ad81-6bd691462157</feedburner:origLink></item>
    <item>
      <title>WSDL Flattening Revisited</title>
      <description>&lt;p&gt;I apologize it has taken so long for me to post this, but as promised, here is the .cs file for the wsdl flattener.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://steverb.com/file.axd?file=2010%2f2%2fFlatWSDL.cs"&gt;FlatWSDL.cs (10.75 kb)&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To use it, you need to modify your web config and add a reference to the library in the behavior extensions section: &lt;/p&gt;
&lt;h3&gt;&amp;nbsp;(YOUR ACTUAL ENTRIES MAY VARY)&lt;/h3&gt;
&lt;pre&gt;&amp;nbsp;&amp;lt;system.serviceModel&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&amp;nbsp; &amp;lt;extensions&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;behaviorExtensions&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;add name="FlatWSDL" type="SteverB.Services.Extensions.FlattenWsdlBehavior, SteverB.Services.Extensions, Version=1.0.0.0, &amp;nbsp;Culture=neutral, PublicKeyToken=[something]" /&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/behaviorExtensions&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&amp;nbsp; &amp;lt;extensions&amp;gt;&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And then to turn it on, modify the service behavior by adding the &amp;lt;FlatWSDL /&amp;gt; tag:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;&amp;lt;behaviors&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&amp;nbsp; &amp;lt;serviceBehaviors&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;behavior name="MyBehavior"&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;serviceMetadata httpGetEnabled="true"/&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;FlatWSDL /&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/behavior&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/serviceBehaviors&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;lt;/behaviors&amp;gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I hope that helps someone!&amp;nbsp;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SteverB/~4/0NVLZN_Rahs" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/SteverB/~3/0NVLZN_Rahs/post.aspx</link>
      <comments>http://steverb.com/post/2010/02/17/WSDL-Flattening-Revisited.aspx#comment</comments>
      <guid isPermaLink="false">http://steverb.com/post.aspx?id=241fbcc7-7ccf-4477-8166-0e3714499e4e</guid>
      <pubDate>Wed, 17 Feb 2010 08:02:00 -1200</pubDate>
      <category>WCF</category>
      <dc:publisher>Stever B</dc:publisher>
      <pingback:server>http://steverb.com/pingback.axd</pingback:server>
      <pingback:target>http://steverb.com/post.aspx?id=241fbcc7-7ccf-4477-8166-0e3714499e4e</pingback:target>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://steverb.com/trackback.axd?id=241fbcc7-7ccf-4477-8166-0e3714499e4e</trackback:ping>
      <wfw:comment>http://steverb.com/post/2010/02/17/WSDL-Flattening-Revisited.aspx#comment</wfw:comment>
      <wfw:commentRss>http://steverb.com/syndication.axd?post=241fbcc7-7ccf-4477-8166-0e3714499e4e</wfw:commentRss>
    <feedburner:origLink>http://steverb.com/post.aspx?id=241fbcc7-7ccf-4477-8166-0e3714499e4e</feedburner:origLink></item>
    <item>
      <title>Recursively Extracting A Zip File in Ruby</title>
      <description>&lt;p&gt;Recently I had the need to let a user upload a zip file and then have the Ruby app extract it and store it in a DB. I turned to google, but beyond some posts recommending using rubyzip to do the zip file handling I couldn't find anything showing a good way to do this recursively without first actually extracting the zip file to disk and then using the dir object.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After much adding and deleting code I have something that works reasonably well. &lt;/p&gt;
&lt;p&gt;First you need to require rubyzip:&lt;/p&gt;
&lt;p&gt;And then we can deal with the file.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;require &lt;span class="rem"&gt;'zip/zip'&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;require &lt;span class="rem"&gt;'zip/zipfilesystem'&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;  def unzip(widget)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;      &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;      #save the zip &lt;span class="kwrd"&gt;to&lt;/span&gt; disk so we can unzip it&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;      filename = widget.guid + &lt;span class="str"&gt;".zip"&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;      File.open(filename, &lt;span class="str"&gt;"w"&lt;/span&gt;) &lt;span class="kwrd"&gt;do&lt;/span&gt; |f|&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        f.write(widget.zip)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;      &lt;span class="kwrd"&gt;end&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;      &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;     &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;      &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;      Zip::ZipFile.open(filename) &lt;span class="kwrd"&gt;do&lt;/span&gt; |zipfile|&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;      iterate_dir(&lt;span class="str"&gt;""&lt;/span&gt;, widget, zipfile)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;      &lt;span class="kwrd"&gt;end&lt;/span&gt; #zipfile open &lt;span class="kwrd"&gt;do&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;      &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;      &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;      &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;      #we&lt;span class="rem"&gt;'re done with the file&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;      File.delete(filename)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;      &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;  &lt;span class="kwrd"&gt;end&lt;/span&gt; #unzip&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;  def iterate_dir(mdir, widget, zipfile)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;    zipfile.dir.entries(mdir).&lt;span class="kwrd"&gt;each&lt;/span&gt; &lt;span class="kwrd"&gt;do&lt;/span&gt; |dir_entry|&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;      file_path = mdir + &lt;span class="str"&gt;"/"&lt;/span&gt; + dir_entry&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;     &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;      &lt;span class="kwrd"&gt;if&lt;/span&gt; !zipfile.file.directory?(file_path)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;            resource = Resource.&lt;span class="kwrd"&gt;new&lt;/span&gt;()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;            resource.widget_id = widget.id&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;            resource.file_name = dir_entry&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;            resource.mime_type = mime_type(file_extension(dir_entry))&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;            resource.file_path = zipfile.file.expand_path(file_path)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;            resource.file_length = zipfile.file.size(file_path)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;            resource.data = zipfile.file.read(file_path)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;            resource.save&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;      &lt;span class="kwrd"&gt;end&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;    &lt;span class="kwrd"&gt;end&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;    &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;    zipfile.dir.entries(mdir).&lt;span class="kwrd"&gt;each&lt;/span&gt; &lt;span class="kwrd"&gt;do&lt;/span&gt; |dir_entry|&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;      file_path = mdir + &lt;span class="str"&gt;"/"&lt;/span&gt; + dir_entry&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;      &lt;span class="kwrd"&gt;if&lt;/span&gt; zipfile.file.directory?(file_path)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  45:  &lt;/span&gt;        iterate_dir(file_path, widget, zipfile) &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  46:  &lt;/span&gt;      &lt;span class="kwrd"&gt;end&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  47:  &lt;/span&gt;    &lt;span class="kwrd"&gt;end&lt;/span&gt;    &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  48:  &lt;/span&gt;  &lt;span class="kwrd"&gt;end&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  49:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is probably a better way to do this, and there is almost certainly a more idiomatically Ruby way to do it, but this works. No guarantees that I got all the blocks closed while cutting and pasting to this blog entry though. Good luck!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SteverB/~4/PhJ-YrKb1Fk" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/SteverB/~3/PhJ-YrKb1Fk/post.aspx</link>
      <comments>http://steverb.com/post/2010/02/12/Recursively-Extracting-A-Zip-File-in-Ruby.aspx#comment</comments>
      <guid isPermaLink="false">http://steverb.com/post.aspx?id=b9834bc3-96a4-45d2-8434-c1dc538024ac</guid>
      <pubDate>Fri, 12 Feb 2010 09:31:00 -1200</pubDate>
      <category>Code</category>
      <dc:publisher>Stever B</dc:publisher>
      <pingback:server>http://steverb.com/pingback.axd</pingback:server>
      <pingback:target>http://steverb.com/post.aspx?id=b9834bc3-96a4-45d2-8434-c1dc538024ac</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://steverb.com/trackback.axd?id=b9834bc3-96a4-45d2-8434-c1dc538024ac</trackback:ping>
      <wfw:comment>http://steverb.com/post/2010/02/12/Recursively-Extracting-A-Zip-File-in-Ruby.aspx#comment</wfw:comment>
      <wfw:commentRss>http://steverb.com/syndication.axd?post=b9834bc3-96a4-45d2-8434-c1dc538024ac</wfw:commentRss>
    <feedburner:origLink>http://steverb.com/post.aspx?id=b9834bc3-96a4-45d2-8434-c1dc538024ac</feedburner:origLink></item>
    <item>
      <title>Error Handling in Ruby</title>
      <description>&lt;p&gt;
I&amp;#39;ve recently begun learning Ruby by working my way through the &lt;a href="http://github.com/edgecase/ruby_koans" title="Edgecase's Ruby Koans"&gt;Ruby Koans&lt;/a&gt;. I finally made it to the section on error handling, which answered a few questions for me.
&lt;/p&gt;
&lt;p&gt;
Once again, Ruby has not surprised me (this is a good thing). There&amp;#39;s just some minor syntactical differences. Specifically in place of &amp;quot;try, catch, finally&amp;quot; Ruby uses &amp;quot;begin, rescue, ensure&amp;quot;.
&lt;/p&gt;
&lt;pre&gt;
begin
  fail &amp;quot;Oops&amp;quot;
rescue StandardError =&amp;gt; ex
  #Do something with the error
ensure
  result = :code_that_always_runs
end 
&lt;/pre&gt;
&lt;p&gt;
&lt;br /&gt;
Since I haven&amp;#39;t made it all the way through the koans yet I&amp;#39;m, probably missing something that seems obvious to long time Ruby users, but so far it&amp;#39;s pretty damned simple. &lt;br /&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SteverB/~4/WXgtdGHMM40" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/SteverB/~3/WXgtdGHMM40/post.aspx</link>
      <comments>http://steverb.com/post/2009/11/09/Error-Handling-in-Ruby.aspx#comment</comments>
      <guid isPermaLink="false">http://steverb.com/post.aspx?id=f5b8b633-6122-4add-a55f-0ec2b51a62a4</guid>
      <pubDate>Mon, 09 Nov 2009 01:57:00 -1200</pubDate>
      <category>Code</category>
      <dc:publisher>Stever B</dc:publisher>
      <pingback:server>http://steverb.com/pingback.axd</pingback:server>
      <pingback:target>http://steverb.com/post.aspx?id=f5b8b633-6122-4add-a55f-0ec2b51a62a4</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://steverb.com/trackback.axd?id=f5b8b633-6122-4add-a55f-0ec2b51a62a4</trackback:ping>
      <wfw:comment>http://steverb.com/post/2009/11/09/Error-Handling-in-Ruby.aspx#comment</wfw:comment>
      <wfw:commentRss>http://steverb.com/syndication.axd?post=f5b8b633-6122-4add-a55f-0ec2b51a62a4</wfw:commentRss>
    <feedburner:origLink>http://steverb.com/post.aspx?id=f5b8b633-6122-4add-a55f-0ec2b51a62a4</feedburner:origLink></item>
    <item>
      <title>Now For Something Completely Different</title>
      <description>&lt;p&gt;
I&amp;rsquo;ve got a few more WCF posts in the cooker, but I thought it might be nice to start the new year off with something a little bit different. This past Thursday, my wife and I were fortunate enough to receive an invite to the &lt;a href="http://www.knoxvillesymphony.com/"&gt;Knoxville Symphony Orchestra&amp;rsquo;s&lt;/a&gt; &amp;ldquo;Blogger&amp;rsquo;s Night&amp;rdquo;. 
&lt;/p&gt;
&lt;p&gt;
I believe this is the second year that the KSO has put on a &lt;a href="http://knoxvillesymphony.blogspot.com/2009/01/bloggers-night-aftermath.html"&gt;blogger&amp;rsquo;s night&lt;/a&gt;. The deal is that Knoxville area bloggers receive free symphony tickets in exchange for writing about the experience. And since my wife and I were in desperate need of some culture and a night out sans children I figured it was a fair trade. I was wrong. I definitely got the better end of the deal.
&lt;/p&gt;
&lt;p&gt;
The performance we attended was Mozart and Mendelssohn, at the &lt;a href="http://www.tennesseetheatre.com/"&gt;Tennessee Theater&lt;/a&gt;, with &lt;a href="http://www.imgartists.com/?page=artist&amp;amp;id=196"&gt;Navah Perlman&lt;/a&gt; performing the piano part in Mozart&amp;rsquo;s Concerto Number 24, in C minor. 
&lt;/p&gt;
&lt;p&gt;
The &lt;a href="http://www.tennesseetheatre.com/"&gt;Tennessee Theater&lt;/a&gt; itself is gorgeous, with a 1920&amp;rsquo;s Spanish-Moorish design, and a jaw droppingly beautiful ambient lighting system. The acoustics were, I thought, spot on as well. I had no problems hearing the orchestra, and was even able to hear the conductor during a brief microphone outage during the introduction.
&lt;/p&gt;
&lt;p&gt;
I&amp;rsquo;m a moderate Mozart fan, in that I like Mozart, have recordings of and can recognize most of his works, but I probably can&amp;rsquo;t name more than two. However, I now know that most of my Mozart recordings suck. I&amp;rsquo;ve never heard it played so well.
&lt;/p&gt;
&lt;p&gt;
So, a thank you to the &lt;a href="http://www.knoxvillesymphony.com/"&gt;KSO&lt;/a&gt; for a wonderful, ear opening experience. I&amp;rsquo;m off to re-buy my meager classical music selection. To everyone else, get out there and listen to some music.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SteverB/~4/um3TlFpA370" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/SteverB/~3/um3TlFpA370/post.aspx</link>
      <comments>http://steverb.com/post/2009/01/20/Now-For-Something-Completely-Different.aspx#comment</comments>
      <guid isPermaLink="false">http://steverb.com/post.aspx?id=b3980e7d-83d7-4a97-8b72-c1a31c2dc887</guid>
      <pubDate>Tue, 20 Jan 2009 17:14:00 -1200</pubDate>
      <category>Knoxville</category>
      <dc:publisher>Stever B</dc:publisher>
      <pingback:server>http://steverb.com/pingback.axd</pingback:server>
      <pingback:target>http://steverb.com/post.aspx?id=b3980e7d-83d7-4a97-8b72-c1a31c2dc887</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://steverb.com/trackback.axd?id=b3980e7d-83d7-4a97-8b72-c1a31c2dc887</trackback:ping>
      <wfw:comment>http://steverb.com/post/2009/01/20/Now-For-Something-Completely-Different.aspx#comment</wfw:comment>
      <wfw:commentRss>http://steverb.com/syndication.axd?post=b3980e7d-83d7-4a97-8b72-c1a31c2dc887</wfw:commentRss>
    <feedburner:origLink>http://steverb.com/post.aspx?id=b3980e7d-83d7-4a97-8b72-c1a31c2dc887</feedburner:origLink></item>
    <item>
      <title>Passing Configuration Values into WCF Behaviors</title>
      <description>&lt;p&gt;Sometimes when &lt;a href="http://www.steverb.com/post/2008/11/24/Useful-WCF-Behaviors-IErrorHandler.aspx"&gt;creating a WCF behavior&lt;/a&gt; it'd be nice to be able to pass in some sort of instance specific configuration information. Fortunately, you can.&lt;/p&gt;  &lt;p&gt;In the previous post we added a class that implemented BehaviorExtensionElement so that we could apply our IServiceBehavior via the config file. There are a few other methods that you can implement so that the BehaviorExtensionElement will pull settings from the config file. This way when you add the behavior you can tell it something special, like what the friendly name of the service is. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;serviceBehaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;behavior&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;TrainingService.Service1Behavior&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;          &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AutoRegister&lt;/span&gt; &lt;span class="attr"&gt;ServiceName&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;TrainingService&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;behavior&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;serviceBehaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;

&lt;p&gt;Simply add a property to the behavior (IServiceBehavior in this instance), then in the class that implements BehaviorExtensionElement, add a property decorated with System.Configuration.ConfigurationProperty.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;        [System.Configuration.ConfigurationProperty(&lt;span class="str"&gt;&amp;quot;ServiceName&amp;quot;&lt;/span&gt;, DefaultValue = &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, IsRequired = &lt;span class="kwrd"&gt;true&lt;/span&gt;)]&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; ServiceName&lt;/pre&gt;

  &lt;pre class="alt"&gt;        {&lt;/pre&gt;

  &lt;pre&gt;            get&lt;/pre&gt;

  &lt;pre class="alt"&gt;            {&lt;/pre&gt;

  &lt;pre&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; (&lt;span class="kwrd"&gt;string&lt;/span&gt;)&lt;span class="kwrd"&gt;base&lt;/span&gt;[&lt;span class="str"&gt;&amp;quot;ServiceName&amp;quot;&lt;/span&gt;];&lt;/pre&gt;

  &lt;pre class="alt"&gt;            }&lt;/pre&gt;

  &lt;pre&gt;            set&lt;/pre&gt;

  &lt;pre class="alt"&gt;            {&lt;/pre&gt;

  &lt;pre&gt;                &lt;span class="kwrd"&gt;base&lt;/span&gt;[&lt;span class="str"&gt;&amp;quot;ServiceName&amp;quot;&lt;/span&gt;] = &lt;span class="kwrd"&gt;value&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            }&lt;/pre&gt;

  &lt;pre&gt;        }&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;In this case, we are simply passing back to the IServiceBehavior.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now add a ConfigurationPropertyCollection and a readonly PropertiesProperty&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; ConfigurationPropertyCollection _prop = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; System.Configuration.ConfigurationPropertyCollection Properties&lt;/pre&gt;

  &lt;pre&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;            get&lt;/pre&gt;

  &lt;pre&gt;            {&lt;/pre&gt;

  &lt;pre class="alt"&gt;                &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;this&lt;/span&gt;._prop == &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;                {&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    &lt;span class="kwrd"&gt;this&lt;/span&gt;._prop = &lt;span class="kwrd"&gt;new&lt;/span&gt; System.Configuration.ConfigurationPropertyCollection();&lt;/pre&gt;

  &lt;pre&gt;                    &lt;span class="kwrd"&gt;this&lt;/span&gt;._prop.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; System.Configuration.ConfigurationProperty(&lt;span class="str"&gt;&amp;quot;ServiceName&amp;quot;&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt;),&lt;/pre&gt;

  &lt;pre class="alt"&gt;                        &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, System.Configuration.ConfigurationPropertyOptions.IsRequired));&lt;/pre&gt;

  &lt;pre&gt;                }&lt;/pre&gt;

  &lt;pre class="alt"&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;._prop;&lt;/pre&gt;

  &lt;pre&gt;            }&lt;/pre&gt;

  &lt;pre class="alt"&gt;        }&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;

&lt;p&gt;Now your IServiceBehavior can get its property set.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SteverB/~4/SWf6uZ0yfA8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/SteverB/~3/SWf6uZ0yfA8/post.aspx</link>
      <comments>http://steverb.com/post/2008/11/25/Passing-Configuration-Values-into-WCF-Behaviors.aspx#comment</comments>
      <guid isPermaLink="false">http://steverb.com/post.aspx?id=320c80a6-e674-4313-93b9-71af9d02c3b6</guid>
      <pubDate>Tue, 25 Nov 2008 10:23:00 -1200</pubDate>
      <dc:publisher>stever b</dc:publisher>
      <pingback:server>http://steverb.com/pingback.axd</pingback:server>
      <pingback:target>http://steverb.com/post.aspx?id=320c80a6-e674-4313-93b9-71af9d02c3b6</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://steverb.com/trackback.axd?id=320c80a6-e674-4313-93b9-71af9d02c3b6</trackback:ping>
      <wfw:comment>http://steverb.com/post/2008/11/25/Passing-Configuration-Values-into-WCF-Behaviors.aspx#comment</wfw:comment>
      <wfw:commentRss>http://steverb.com/syndication.axd?post=320c80a6-e674-4313-93b9-71af9d02c3b6</wfw:commentRss>
    <feedburner:origLink>http://steverb.com/post.aspx?id=320c80a6-e674-4313-93b9-71af9d02c3b6</feedburner:origLink></item>
  </channel>
</rss>

