This may or may not be the problem, but Google implements OAuth a little bit weird in the first token request... the key is actually the concatenation of the URLencoded customer secret, an '&' and the token secret. If the token secret is blank (as it is in the first token request), there's a dangling '&' on the end of the customer secret. I didn't see this in any of Googles (or OAuth's) docs, and only found it because I traced the source code of the oauth playground.
On Apr 11, 5:58 am, greenfish <[email protected]> wrote: > i can not receive request token from google. > > argc = oauth_split_url_parameters("https://www.google.com/accounts/ > OAuthGetRequestToken?scope=http://www.google.com/calendar/feeds/ > default/allcalendars/full", &argv); > > oauth_sign_array2_process(&argc, &argv, NULL, OA_HMAC, NULL, > "greenfishblog.tistory.com", "Eo/rFfNmK4NGxYlvGpdrK+fF", NULL, NULL); > > req_hdr = oauth_serialize_url_sep(argc, 1, argv, ", ", 6); > > req_url = oauth_serialize_url_sep(argc, 0, argv, "&", 1); > > sprintf(http_hdr, "Authorization: OAuth, %s", req_hdr); > > reply = (*pfn_oauth_http_get2)(lpszRequestTokenURLA, NULL, req_hdr); > > the reply is, > "parameter_absent.oauth_parameters_absent:oauth_consumer_key&oauth_signature_method&oauth_signature&oauth_timestamp&oauth_nonce&scope" > > On 4월11일, 오후6시08분, Robin Gareus <[email protected]> wrote: > > > > > > > > > On Apr 11, 2011, at 4:29 AM, greenfish wrote: > > > > i'll make a google api client application in Windows with liboauth(c+ > > > +). > > > > my consumer key is "greenfishblog.tistory.com" and > > > customersecret is "Eo/rFfNmK4NGxYlvGpdrK+fF". > > > > but, on requesting a token, the reply from google is > > > "signature_invalid.base_string". > > > what's ploblem? > > > > <psuedo code> > > > > #include "oauth.h" > > > ... > > > oauth_split_url_parameter("https://www.google.com/accounts/ > > > OAuthGetRequestToken", &argv); > > > oauth_sign_array2_process(&argc, &argv, NULL, OA_HMAC, NULL, > > > "greenfi....", "Eo/r...", NULL, NULL); > > > req_hdr = oauth_serialize_url_sep(argc, 1, argv, ", ", 6); > > > req_url = oauth_serialize_url_sep(argc, 0, argv, ", ", 1); > > > sprintf(http_hdr, "Authorization: OAuth scope=\"%s\", %s", ("http:// > > >www.google.com/calendar/feeds/default/allcalendars/full"), req_hdr); > > > reply = oauth_http_get2("https://www.google.com/accounts/ > > > OAuthGetRequestToken", NULL, http_hdr); > > > > at last, > > > reply is "signature_invalid.base_string:GET&http ..." > > > Pseudo code is not very useful for debugging. > > A shot in the dark: If you use an OAuth scope header, it needs to add it > > to the request parameters to be singed. > > > oauth_split_url_parameter("https://my.url?scope=MYOAUTHSCOPE",...); > > > best, > > robin- 원본 텍스트 숨기기 - > > > - 원본 텍스트 보기 - -- You received this message because you are subscribed to the Google Groups "OAuth" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/oauth?hl=en.
