开发者

OAuth API Request Token Invalid Signature

Invalid Signature Bad Request 401 when trying to Access Google Oauth Rquest token API by doing a get Request to

https://www.google.com/accounts/OAuthGetRequestToken?oauth_callback=http://googlecodesamples.com/oauth_playground/findex.php&oauth_consumer_key=www.laredoute.fr&oauth_nonce=264800&oauth_signature_method=HMAC-SHA1&oauth_t开发者_开发百科imestamp=1287117306&oauth_version=1.0&scope=https://www.google.com/m8/feeds&oauth_signature=wVOLVMEYRq1E+A3OmcroKkWjsPg=

with the following Signature base string base string to generate Oauth signature.

GET&oauth_consumer_key%3Dkey%26oauth_nonce%3D8919381%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1287117115%26oauth_version%3D1&oauth_consumer_key%3Dkey%26oauth_nonce%3D8919381%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1287117115%26oauth_version%3D1

Thanks, sunil


This is all due to encoding issues. You may refer to http://code.google.com/p/socialauth-net/ library which wraps up all handshake and tokens complexities and provide ability to login with just following code:

SocialAuthUser.CreateUser("Google");
SocialAuthuser.GetCurrentuser.Login();

Thats it! These 2 lines will automatically redirect user to google login screen and redirect back after authentication. Other supported providers are facebook, Yahoo and MSN.

Besides, you may also retrieve profiles and friends list with simple methods like:

SocialAuthuser.GetCurrentUser().GetContacts()
SocialAuthuser.GetCurrentUser().GetProfile()

It is an opensource and soon sourcecode will be available which you may read to fix your problem in case you do not wish to use this component.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜