Hi, Though your code sets a 'scope' parameter to retrieve user's protected resource, I think the parameter causes the issue because it isn't necessary in this step. The 'scope' parameter is used only for retrieving the unauthorized request token; that is, first step of OAuth. The 'scope' parameter is a google specific parameter, it isn't defined in OAuth v1.0, v1.0a.
On 12月8日, 午後6:31, "ionut.andras" <[email protected]> wrote: > Hi all, > > I'm quite new to OAuth authentication and I'm trying to make a web > application which allows users to login with their google accounts and > then I need their credentials to fill a profile. My problem is that > after completing the oauth 3 steps: GetRequestToken, AuthorizeToken, > GetAccesstoken, I can not perform the last request to get the user > details. > > I'm using the following code to get user credentials after getting the > access tokens > > $_signature_method = new OAuthSignatureMethod_HMAC_SHA1(); > $_consumer = new OAuthConsumer($oauth_consumer_key, > $oauth_consumer_secret, null); > $_token = new OAuthToken($_SESSION['token']['key'], $_SESSION['token'] > ['secret']); > > $parameters = array( > 'scope'=> $my_auth->oauth_scope //"http://www- > opensocial.googleusercontent.com/api/people/" > ); > $_request = OAuthRequest::from_consumer_and_token($_consumer, $_token, > "GET", "http://www-opensocial.googleusercontent.com/api/people/@me/ > @all", $parameters); > $_request->sign_request($_signature_method, $_consumer, $_token); > > if (false !== ($result = file_get_contents($_request->to_url()))){ > print_r($result); > > } > > I need some urgent help please because this things has killed my time > for the last couple days. > > Regards -- 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.
