<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: OAuth C# (very) Basic Library</title>
	<atom:link href="http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/feed/" rel="self" type="application/rss+xml" />
	<link>http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/</link>
	<description>Not biting dust since 2005</description>
	<lastBuildDate>Tue, 09 Mar 2010 12:08:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Eran Sandler</title>
		<link>http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/comment-page-1/#comment-42798</link>
		<dc:creator>Eran Sandler</dc:creator>
		<pubDate>Fri, 19 Feb 2010 07:03:22 +0000</pubDate>
		<guid isPermaLink="false">http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/#comment-42798</guid>
		<description>I would suggest to use the signature code from google. I think they have that in their sdk. At first glance this seems to be a signature issue so check the parameters you pass to the signature function.</description>
		<content:encoded><![CDATA[<p>I would suggest to use the signature code from google. I think they have that in their sdk. At first glance this seems to be a signature issue so check the parameters you pass to the signature function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: venkata</title>
		<link>http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/comment-page-1/#comment-42201</link>
		<dc:creator>venkata</dc:creator>
		<pubDate>Wed, 03 Feb 2010 16:18:50 +0000</pubDate>
		<guid isPermaLink="false">http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/#comment-42201</guid>
		<description>hi,

I am trying to develop an appilication which will contact google using OAuth.

but i am getting this error message

signature_invalid
base_string:GET&amp;https%3A%2F%2Fwww.google.com%2Faccounts%2FOAuthGetRequestToken&amp;oauth_consumer_key%3Dwww.frooly.com%26oauth_nonce%3D8841340%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1265201014%26oauth_version%3D1.0%26scope%3Dhttp%253A%252F%252Fwww.google.com%252Fcalendar%252Ffeeds

I have registered with google and got consumer key and secret also. and the domain is status is Active.

well my code is able to get the request token from twitter but fails with google. any idea ?



please help me.

kind regards,</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>I am trying to develop an appilication which will contact google using OAuth.</p>
<p>but i am getting this error message</p>
<p>signature_invalid<br />
base_string:GET&#038;https%3A%2F%2Fwww.google.com%2Faccounts%2FOAuthGetRequestToken&#038;oauth_consumer_key%3Dwww.frooly.com%26oauth_nonce%3D8841340%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1265201014%26oauth_version%3D1.0%26scope%3Dhttp%253A%252F%252Fwww.google.com%252Fcalendar%252Ffeeds</p>
<p>I have registered with google and got consumer key and secret also. and the domain is status is Active.</p>
<p>well my code is able to get the request token from twitter but fails with google. any idea ?</p>
<p>please help me.</p>
<p>kind regards,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Friedman</title>
		<link>http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/comment-page-1/#comment-36988</link>
		<dc:creator>David Friedman</dc:creator>
		<pubDate>Tue, 13 Oct 2009 09:47:22 +0000</pubDate>
		<guid isPermaLink="false">http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/#comment-36988</guid>
		<description>Hello Eran!

Your Oauth Base class gave me a big help! I&#039;ve started only with a portion of the features of OAuth, so Your basic C# was a big help.
However :), maybe my experience could help others too:
- Your UrlEncode is not prepared for international characters - i returned to HttpUtiliity.UrlEncode and capitalised the %__ parts
- QueryParameterComparer used Compare needs the extra (3rd) StringComparison.Ordinal parameter to Order the params in the specified (&quot;lexicographical byte value ordering&quot;) order (all capitalised ABC first, then comes abc).
thnx, 
{:-D</description>
		<content:encoded><![CDATA[<p>Hello Eran!</p>
<p>Your Oauth Base class gave me a big help! I&#8217;ve started only with a portion of the features of OAuth, so Your basic C# was a big help.<br />
However <img src='http://eran.sandler.co.il/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , maybe my experience could help others too:<br />
- Your UrlEncode is not prepared for international characters &#8211; i returned to HttpUtiliity.UrlEncode and capitalised the %__ parts<br />
- QueryParameterComparer used Compare needs the extra (3rd) StringComparison.Ordinal parameter to Order the params in the specified (&#8220;lexicographical byte value ordering&#8221;) order (all capitalised ABC first, then comes abc).<br />
thnx,<br />
{:-D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eran Sandler</title>
		<link>http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/comment-page-1/#comment-27035</link>
		<dc:creator>Eran Sandler</dc:creator>
		<pubDate>Fri, 24 Oct 2008 09:17:22 +0000</pubDate>
		<guid isPermaLink="false">http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/#comment-27035</guid>
		<description>David, have you looked at this step-by-step tutorial by Jospeh Smarr - http://josephsmarr.com/2008/10/01/using-netflixs-new-api-a-step-by-step-guide/

It has all the values of each steps that you can compare and see if it all works well.</description>
		<content:encoded><![CDATA[<p>David, have you looked at this step-by-step tutorial by Jospeh Smarr &#8211; <a href="http://josephsmarr.com/2008/10/01/using-netflixs-new-api-a-step-by-step-guide/" rel="nofollow">http://josephsmarr.com/2008/10/01/using-netflixs-new-api-a-step-by-step-guide/</a></p>
<p>It has all the values of each steps that you can compare and see if it all works well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/comment-page-1/#comment-27032</link>
		<dc:creator>David</dc:creator>
		<pubDate>Thu, 23 Oct 2008 18:07:26 +0000</pubDate>
		<guid isPermaLink="false">http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/#comment-27032</guid>
		<description>I&#039;m trying it out, but the signatures it is generating are not accepted by the Netflix API...I get a bad request
I was wondering if I can be of some help to debug it.</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying it out, but the signatures it is generating are not accepted by the Netflix API&#8230;I get a bad request<br />
I was wondering if I can be of some help to debug it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: memel</title>
		<link>http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/comment-page-1/#comment-26717</link>
		<dc:creator>memel</dc:creator>
		<pubDate>Mon, 22 Sep 2008 20:10:42 +0000</pubDate>
		<guid isPermaLink="false">http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/#comment-26717</guid>
		<description>has someone a solution that works in app opensocial, accessing a page in c #?

the code below (Suggested by Mukesh) always return false.

if (!string.IsNullOrEmpty(Request[&quot;oauth_signature&quot;]))
{

                    string certificateValue = @&quot;-----BEGIN CERTIFICATE----- 
                                                            MIIDHDCCAoWgAwIBAgIJAMbTCksqLiWeMA0GCSqGSIb3DQEBBQUAMGgxCzAJBgNV 
                                                            BAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIG 
                                                            A1UEChMLR29vZ2xlIEluYy4xDjAMBgNVBAsTBU9ya3V0MQ4wDAYDVQQDEwVscnlh 
                                                            bjAeFw0wODAxMDgxOTE1MjdaFw0wOTAxMDcxOTE1MjdaMGgxCzAJBgNVBAYTAlVT 
                                                            MQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChML 
                                                            R29vZ2xlIEluYy4xDjAMBgNVBAsTBU9ya3V0MQ4wDAYDVQQDEwVscnlhbjCBnzAN 
                                                            BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAseBXZ4NDhm24nX3sJRiZJhvy9eDZX12G 
                                                            j4HWAMmhAcnm2iBgYpAigwhVHtOs+ZIUIdzQHvHeNd0ydc1Jg8e+C+Mlzo38OvaG 
                                                            D3qwvzJ0LNn7L80c0XVrvEALdD9zrO+0XSZpTK9PJrl2W59lZlJFUk3pV+jFR8NY 
                                                            eB/fto7AVtECAwEAAaOBzTCByjAdBgNVHQ4EFgQUv7TZGZaI+FifzjpTVjtPHSvb 
                                                            XqUwgZoGA1UdIwSBkjCBj4AUv7TZGZaI+FifzjpTVjtPHSvbXqWhbKRqMGgxCzAJ 
                                                            BgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEU 
                                                            MBIGA1UEChMLR29vZ2xlIEluYy4xDjAMBgNVBAsTBU9ya3V0MQ4wDAYDVQQDEwVs 
                                                            cnlhboIJAMbTCksqLiWeMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEA 
                                                            CETnhlEnCJVDXoEtSSwUBLP/147sqiu9a4TNqchTHJObwTwDPUMaU6XIs2OTMmFu 
                                                            GeIYpkHXzTa9Q6IKlc7Bt2xkSeY3siRWCxvZekMxPvv7YTcnaVlZzHrVfAzqNsTG 
                                                            P3J//C0j+8JWg6G+zuo5k7pNRKDY76GxxHPYamdLfwk= 
                                                            -----END CERTIFICATE-----&quot;;

                    X509Certificate2 cert = new X509Certificate2(Encoding.ASCII.GetBytes(certificateValue), &quot;&quot;, X509KeyStorageFlags.MachineKeySet);
                    System.Collections.Specialized.NameValueCollection queryString = Request.QueryString;
                    string signature = Request[&quot;oauth_signature&quot;];
                    //Base64Decoder decoder = new Base64Decoder(signature.ToCharArray());
                    byte[] sign = Convert.FromBase64String(signature);

                    String urvl, urlNPAM;

                    RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)cert.PublicKey.Key;
                    OAuth.OAuthBase asd = new OAuth.OAuthBase();
                    string url = Request.Url.ToString();
                    foreach (string name in Request.Form)
                        url += &quot;&amp;&quot; + name + &quot;=&quot; + Request.Form[name];
                    Uri reqURi = new Uri(url);
                    string signatureBase = asd.GenerateSignatureBase(reqURi, Request[&quot;oauth_consumer_key&quot;], &quot;&quot;, &quot;&quot;,
                        Request.ServerVariables[&quot;REQUEST_METHOD&quot;].ToUpper(), Request[&quot;oauth_timestamp&quot;],
                        Request[&quot;oauth_nonce&quot;], Request[&quot;oauth_signature_method&quot;], out urvl, out urlNPAM);
                    bool rtn = rsa.VerifyData(
                        Encoding.ASCII.GetBytes(signatureBase), &quot;SHA1&quot;, sign);
                   
                    Response.Write(rtn);
}</description>
		<content:encoded><![CDATA[<p>has someone a solution that works in app opensocial, accessing a page in c #?</p>
<p>the code below (Suggested by Mukesh) always return false.</p>
<p>if (!string.IsNullOrEmpty(Request["oauth_signature"]))<br />
{</p>
<p>                    string certificateValue = @&#8221;&#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;<br />
                                                            MIIDHDCCAoWgAwIBAgIJAMbTCksqLiWeMA0GCSqGSIb3DQEBBQUAMGgxCzAJBgNV<br />
                                                            BAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIG<br />
                                                            A1UEChMLR29vZ2xlIEluYy4xDjAMBgNVBAsTBU9ya3V0MQ4wDAYDVQQDEwVscnlh<br />
                                                            bjAeFw0wODAxMDgxOTE1MjdaFw0wOTAxMDcxOTE1MjdaMGgxCzAJBgNVBAYTAlVT<br />
                                                            MQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChML<br />
                                                            R29vZ2xlIEluYy4xDjAMBgNVBAsTBU9ya3V0MQ4wDAYDVQQDEwVscnlhbjCBnzAN<br />
                                                            BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAseBXZ4NDhm24nX3sJRiZJhvy9eDZX12G<br />
                                                            j4HWAMmhAcnm2iBgYpAigwhVHtOs+ZIUIdzQHvHeNd0ydc1Jg8e+C+Mlzo38OvaG<br />
                                                            D3qwvzJ0LNn7L80c0XVrvEALdD9zrO+0XSZpTK9PJrl2W59lZlJFUk3pV+jFR8NY<br />
                                                            eB/fto7AVtECAwEAAaOBzTCByjAdBgNVHQ4EFgQUv7TZGZaI+FifzjpTVjtPHSvb<br />
                                                            XqUwgZoGA1UdIwSBkjCBj4AUv7TZGZaI+FifzjpTVjtPHSvbXqWhbKRqMGgxCzAJ<br />
                                                            BgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEU<br />
                                                            MBIGA1UEChMLR29vZ2xlIEluYy4xDjAMBgNVBAsTBU9ya3V0MQ4wDAYDVQQDEwVs<br />
                                                            cnlhboIJAMbTCksqLiWeMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEA<br />
                                                            CETnhlEnCJVDXoEtSSwUBLP/147sqiu9a4TNqchTHJObwTwDPUMaU6XIs2OTMmFu<br />
                                                            GeIYpkHXzTa9Q6IKlc7Bt2xkSeY3siRWCxvZekMxPvv7YTcnaVlZzHrVfAzqNsTG<br />
                                                            P3J//C0j+8JWg6G+zuo5k7pNRKDY76GxxHPYamdLfwk=<br />
                                                            &#8212;&#8211;END CERTIFICATE&#8212;&#8211;&#8221;;</p>
<p>                    X509Certificate2 cert = new X509Certificate2(Encoding.ASCII.GetBytes(certificateValue), &#8220;&#8221;, X509KeyStorageFlags.MachineKeySet);<br />
                    System.Collections.Specialized.NameValueCollection queryString = Request.QueryString;<br />
                    string signature = Request["oauth_signature"];<br />
                    //Base64Decoder decoder = new Base64Decoder(signature.ToCharArray());<br />
                    byte[] sign = Convert.FromBase64String(signature);</p>
<p>                    String urvl, urlNPAM;</p>
<p>                    RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)cert.PublicKey.Key;<br />
                    OAuth.OAuthBase asd = new OAuth.OAuthBase();<br />
                    string url = Request.Url.ToString();<br />
                    foreach (string name in Request.Form)<br />
                        url += &#8220;&amp;&#8221; + name + &#8220;=&#8221; + Request.Form[name];<br />
                    Uri reqURi = new Uri(url);<br />
                    string signatureBase = asd.GenerateSignatureBase(reqURi, Request["oauth_consumer_key"], &#8220;&#8221;, &#8220;&#8221;,<br />
                        Request.ServerVariables["REQUEST_METHOD"].ToUpper(), Request["oauth_timestamp"],<br />
                        Request["oauth_nonce"], Request["oauth_signature_method"], out urvl, out urlNPAM);<br />
                    bool rtn = rsa.VerifyData(<br />
                        Encoding.ASCII.GetBytes(signatureBase), &#8220;SHA1&#8243;, sign);</p>
<p>                    Response.Write(rtn);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mukesh</title>
		<link>http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/comment-page-1/#comment-26393</link>
		<dc:creator>Mukesh</dc:creator>
		<pubDate>Thu, 07 Aug 2008 11:55:53 +0000</pubDate>
		<guid isPermaLink="false">http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/#comment-26393</guid>
		<description>I have an Another Solution For error when request having both post and get data

http://coderheaven.blogspot.com/2008/08/authenticate-oauth-signature-in-corkut.html</description>
		<content:encoded><![CDATA[<p>I have an Another Solution For error when request having both post and get data</p>
<p><a href="http://coderheaven.blogspot.com/2008/08/authenticate-oauth-signature-in-corkut.html" rel="nofollow">http://coderheaven.blogspot.com/2008/08/authenticate-oauth-signature-in-corkut.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eran Sandler</title>
		<link>http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/comment-page-1/#comment-23665</link>
		<dc:creator>Eran Sandler</dc:creator>
		<pubDate>Mon, 19 May 2008 13:35:19 +0000</pubDate>
		<guid isPermaLink="false">http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/#comment-23665</guid>
		<description>Hi Steve,

I&#039;ve checked in a version that simply casts the double returned from ts.TotalSeconds into an int64 (just in case) so that the &quot;ToString&quot; method will not return a decimal number (only an integer) which is what you need.

The latest version is checked in so you can get it from the usual place.</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>I&#8217;ve checked in a version that simply casts the double returned from ts.TotalSeconds into an int64 (just in case) so that the &#8220;ToString&#8221; method will not return a decimal number (only an integer) which is what you need.</p>
<p>The latest version is checked in so you can get it from the usual place.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eran Sandler</title>
		<link>http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/comment-page-1/#comment-21329</link>
		<dc:creator>Eran Sandler</dc:creator>
		<pubDate>Tue, 22 Apr 2008 19:16:18 +0000</pubDate>
		<guid isPermaLink="false">http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/#comment-21329</guid>
		<description>Hi Steve, thanks for the fix.
Perhaps I was too precise with that time :-)

I think there is a better way of fixing it instead of substringing the timestamp string, but I&#039;ll look into that and release a fix.</description>
		<content:encoded><![CDATA[<p>Hi Steve, thanks for the fix.<br />
Perhaps I was too precise with that time <img src='http://eran.sandler.co.il/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I think there is a better way of fixing it instead of substringing the timestamp string, but I&#8217;ll look into that and release a fix.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/comment-page-1/#comment-21051</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Sun, 20 Apr 2008 02:19:31 +0000</pubDate>
		<guid isPermaLink="false">http://eran.sandler.co.il/2007/10/17/oauth-c-very-basic-library/#comment-21051</guid>
		<description>maybe its just me, but using this c# library, the timestamp it generates is incorrect. it comes out with .  ex (1208643626.611) - if i cut off the .611, then it works. Otherwise I get invalid signature when doing oauth requests (tested here: http://term.ie/oauth/example/) and with the pownce oauth... 

I changed GetTimeStamp to 

        public virtual string GenerateTimeStamp() {
            // Default implementation of UNIX time of the current UTC time
            TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
            string timeStamp = ts.TotalSeconds.ToString();
            timeStamp = timeStamp.Substring(0, timeStamp.IndexOf(&quot;.&quot;));
            return timeStamp;            
        }</description>
		<content:encoded><![CDATA[<p>maybe its just me, but using this c# library, the timestamp it generates is incorrect. it comes out with .  ex (1208643626.611) &#8211; if i cut off the .611, then it works. Otherwise I get invalid signature when doing oauth requests (tested here: <a href="http://term.ie/oauth/example/)" rel="nofollow">http://term.ie/oauth/example/)</a> and with the pownce oauth&#8230; </p>
<p>I changed GetTimeStamp to </p>
<p>        public virtual string GenerateTimeStamp() {<br />
            // Default implementation of UNIX time of the current UTC time<br />
            TimeSpan ts = DateTime.UtcNow &#8211; new DateTime(1970, 1, 1, 0, 0, 0, 0);<br />
            string timeStamp = ts.TotalSeconds.ToString();<br />
            timeStamp = timeStamp.Substring(0, timeStamp.IndexOf(&#8220;.&#8221;));<br />
            return timeStamp;<br />
        }</p>
]]></content:encoded>
	</item>
</channel>
</rss>
