Folks please help me in this issue.

Thanks,
-Akash

On Nov 6, 5:50 pm, Akash <akashmaheshw...@gmail.com> wrote:
> Hi Robson,
>    Thanks a lot for the reply. I am still not able to get it working :-
> (. Please note I am using ASP.NET web services.
>
>  Here is my exact code snippet that I am using for proof of concept
> for getting authentication working.
>
>         public string GenerateSignatureBase(Uri url, string
> consumerKey, string consumerSecret, string token, string tokenSecret,
> string httpMethod, string timeStamp, string nonce, string
> signatureType)
>         {
>             List<QueryParameter> parameters = new List<QueryParameter>
> ();
>             parameters.Add(new QueryParameter
> ("oauth_body_hash","Ky4lfOVNobK9k5TFKBaax4p1QXk="));
>             parameters.Add(new QueryParameter
> ("oauth_consumer_key","orkut.com"));
>             parameters.Add(new QueryParameter("oauth_nonce",
> "1257504988478336000"));
>             parameters.Add(new QueryParameter
> ("oauth_signature_method","RSA-SHA1"));
>             parameters.Add(new QueryParameter("oauth_timestamp",
> "1257504988"));
>             parameters.Add(new QueryParameter("oauth_version","1.0"));
>             parameters.Add(new QueryParameter
> ("opensocial_app_id","07513949224686644859"));
>             parameters.Add(new QueryParameter
> ("opensocial_app_url","http://www.knownmarket.com/KMWeb/
> KnownMarket.xml"));
>             parameters.Add(new QueryParameter
> ("opensocial_container","http://www.orkut.com";));
>             parameters.Add(new QueryParameter
> ("opensocial_owner_id","04260157720044639260"));
>             parameters.Add(new QueryParameter
> ("opensocial_viewer_id","04260157720044639260"));
>             parameters.Add(new QueryParameter("xoauth_public_key","pub.
> 1199819524.-1556113204990931254.cer"));
>             parameters.Add(new QueryParameter
> ("xoauth_signature_publickey","pub.
> 1199819524.-1556113204990931254.cer"));
>             parameters.Add(new QueryParameter("oauth_token", ""));
>
>             parameters.Sort(new QueryParameterComparer());
>
>             string normalizedRequestParameters =
> NormalizeRequestParameters(parameters);
>
>             StringBuilder signatureBase = new StringBuilder();
>             signatureBase.AppendFormat("{0}&", "POST");
>             signatureBase.AppendFormat("{0}&", 
> UrlEncode("http://www.knownmarket.com/KMWeb/listingSvc.asmx";));
>             signatureBase.AppendFormat("{0}", UrlEncode
> (normalizedRequestParameters));
>             return signatureBase.ToString();
>         }
>
>             X509Certificate Cert = X509Certificate.CreateFromCertFile
> ( Request.PhysicalApplicationPath +  "/bin/pub.
> 1199819524.-1556113204990931254.cer");
>             RSACryptoServiceProvider Provider =
> CertUtil.GetCertPublicKey(Cert);
>             OAuth.OAuthBase ba = new OAuthBase();
>             string baseString = ba.GenerateSignatureBase(Request.Url,
> Request.QueryString["oauth_consumer_key"], "", Request.QueryString
> ["oauth_token"], "", Request.HttpMethod, Request.QueryString
> ["oauth_timestamp"], Request.QueryString["oauth_nonce"], "RSA-SHA1");
>
>             string signature = "gTlTW2N5WysQNzfvc2/tT4+ZkIviFEaj2xoB/
> wInZR8+rtwrbNNuKl+jDLx5QQ71Z6LIacBogaXRw3eA0U/PWiF6G1Hwhd/
> 4+GHlBBXsaKLsC1Ar6/e0D5pvAzN97a8KWfBHMg5kwsF3+OrxVd6Hph+OLRWEUSs/
> wyG3HK2GpOE=";
>             byte[] sign = Convert.FromBase64String(signature);
>
>             byte[] bstring = Encoding.UTF8.GetBytes(baseString);
>             Response.Write(Provider.VerifyData(bstring, "SHA1",
> sign));
>
> Thanks,
> -Akash
>
> On Nov 2, 1:29 am, Robson Dantas <biu.dan...@gmail.com> wrote:
>
> > Sorry, sent you the java version. Here is the link for .NET
>
> >http://code.google.com/p/opensocial-net-client/
>
> > Cheers
>
> > Robson Dantas
>
> > 2009/11/1 Robson Dantas <biu.dan...@gmail.com>
>
> > >Akash,
>
> > > I dont know what kind of oauth lib you´re using, but i got some problems
> > > too, using the library which was described on wiki.opensocial.org .
>
> > > After spending some time debugging, figured out that it was a problem on
> > > the lib. Just tried another one, and worked. I´ve also updated the wiki, 
> > > so,
> > > try to use this lib:
>
> > >http://code.google.com/p/opensocial-java-client/
>
> > > Let me know if it helps you.
>
> > > Robson Dantas
>
> > > 2009/10/28Akash<akashmaheshw...@gmail.com>
>
> > >> Not sure what was Ranjit's problem. My application is still having
> > >> issues.
>
> > >> On Oct 26, 9:38 pm, Ranjeet Gill <rsgill.m...@gmail.com> wrote:
> > >> > Thanks its working now.
> > >> > Ranjit
>
> > >> > On Mon, Oct 26, 2009 at 4:11 AM,Akash<akashmaheshw...@gmail.com>
> > >> wrote:
>
> > >> > > Yes checked and found certificate is not the issue.
>
> > >> > > Any idea on after looking at the code whether it is fine?
>
> > >> > > Thanks
>
> > >> > > On Oct 13, 7:44 pm, "jeswa...@gmail.com" <jeswa...@gmail.com> wrote:
> > >> > > > check your cetificate file. Be sure not to open or save 
> > >> > > > certificates
> > >> > > > in wordpad etc use notepad
>
> > >> > > > On Oct 10, 7:45 pm,Akash<akashmaheshw...@gmail.com> wrote:
>
> > >> > > > > Hi,
> > >> > > > >    I am running into some issues regarding Authentication of my
> > >> signed
> > >> > > > > request. Validation of signed request always fails.
>
> > >> > > > > For simplicity of debugging, Here are the list of parameters that
> > >> I am
> > >> > > > > using to generate base string
>
> > >> > > > >     List<QueryParameter> parameters = new List<QueryParameter>();
> > >> > > > >     parameters.Add(new QueryParameter("oauth_nonce" ,
> > >> > > > > "1255174236461304000"));
> > >> > > > >     parameters.Add(new QueryParameter("oauth_timestamp",
> > >> > > > > "1255174236"));
> > >> > > > >     parameters.Add(new QueryParameter("oauth_signature_method",
> > >> "RSA-
> > >> > > > > SHA1"));
> > >> > > > >     parameters.Add(new QueryParameter("oauth_consumer_key",
> > >> > > > > "orkut.com"));
> > >> > > > >     parameters.Add(new QueryParameter("oauth_token", ""));
> > >> > > > >     parameters.Add(new QueryParameter("opensocial_owner_id",
> > >> > > > > "04260157720044639260"));
> > >> > > > >     parameters.Add(new QueryParameter("opensocial_viewer_id",
> > >> > > > > "04260157720044639260"));
> > >> > > > >     parameters.Add(new QueryParameter("opensocial_app_id",
> > >> > > > > "07513949224686644859"));
> > >> > > > >     parameters.Add(new QueryParameter("opensocial_app_url", "
> > >> > >http://www.knownmarket.com/KMWeb/KnownMarket.xml";));
> > >> > > > >     parameters.Add(new
> > >> QueryParameter("xoauth_signature_publickey",
> > >> > > > > "pub.1199819524.-1556113204990931254.cer"));
>
> > >> > > > > //Commented Out because including also didnt help
> > >> > > > >     //parameters.Add(new QueryParameter("opensocial_container",
> > >> > > > > "http://www.orkut.com";));
> > >> > > > >     //parameters.Add(new QueryParameter("oauth_body_hash",
> > >> > > > > "HC2N0z5sbRPkI4csJ00ilMlXzes="));
> > >> > > > >     //parameters.Add(new QueryParameter("xoauth_public_key", 
> > >> > > > > "pub.
> > >> > > > > 1199819524.-1556113204990931254.cer"));
> > >> > > > >     //parameters.Add(new QueryParameter("oauth_version","1.0"));
>
> > >> > > > >       parameters.Sort(new QueryParameterComparer());
>
> > >> > > > >       string normalizedUrl = "http://www.knownmarket.com/KMWeb/
> > >> > > > > ListingSvc.asmx";
>
> > >> > > > >      string normalizedRequestParameters =
> > >> NormalizeRequestParameters
> > >> > > > > (parameters);
>
> > >> > > > >             StringBuilder signatureBase = new StringBuilder();
> > >> > > > >             signatureBase.AppendFormat("{0}&", "POST");
> > >> > > > >             signatureBase.AppendFormat("{0}&", UrlEncode
> > >> > > > > (normalizedUrl));
> > >> > > > >             signatureBase.AppendFormat("{0}", UrlEncode
> > >> > > > > (normalizedRequestParameters));
> > >> > > > >             return signatureBase.ToString();
>
> > >> > > > > I tried the C# example provided onhttp://
> > >> > > wiki.opensocial.org/index.php?title=Validating_Signed_Requests
> > >> > > > > but even that didnt help.
>
> > >> > > > > Gurus, do let me know if I am missing out anything here?
>
> > >> > > > > Thanks,
> > >> > > > > -Akash- Hide quoted text -
>
> > >> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-orkut+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to