
devdefined-tools - issue #1
Can't validate signed requests from OpenSocial applications
Originally reported by a library user via email - details as follows:
Hi Alex,
Hope you don’t mind some random punter emailing you about the OAuth code you created..
Thanks for the code by the way, I was trying to do something similar but you saved me a load of time.
I just have a quick query.. I am trying to get the RSA Implementation to work but the validation keeps failing.
I copied the way you outlined in the google groops (http://code.google.com/p/devdefined-tools/wiki/OAuthSignatureValidation) and this is what I ended up with..
(I must add that I am using a local certificate I got from friendster and I don’t have a consumer secret.)
OAuthContext context = new OAuthContextBuilder().FromHttpRequest(Request);
OAuthContextSigner signer = new OAuthContextSigner();
SigningContext signingContext = new SigningContext();
X509Certificate2 x509 = new X509Certificate2(Server.MapPath("/Certs/friendster.crt"));
signingContext.Algorithm = (RSACryptoServiceProvider)x509.PublicKey.Key; // if a certificate is associated with the consumer (for RSA-SHA1 etc.)
signingContext.ConsumerSecret = ""; // if there is a consumer secret
if (!signer.ValidateSignature(context, signingContext)) { . . .
It seems quite straight forward but I can’t seem to get the signature to validate correctly.. I also don’t have the private key, which means (i think) that I can’t recreate the signature to help me test and find out where I’m going wrong.
Anyways, any suggestions would be very much appreciated.. thanks again for the code.
Kind regards,
Eoin
PollDaddy.com
Comment #1
Posted on Sep 21, 2008 by Swift KangarooFixed, see example here:
https://devdefined-tools.googlecode.com/svn/trunk/projects/oauth/OpenSocialProviderSite
Was caused by trailing ampersand ("&") on the request url.
Comment #2
Posted on Apr 6, 2010 by Swift KangarooFixed.
Status: Fixed
Labels:
Type-Defect
Priority-Medium