yhtsnda / oauth-dot-net

Automatically exported from code.google.com/p/oauth-dot-net
0 stars 0 forks source link

Google API parameter scope #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I do not know if somebody can help me.
I am trying to submit a token request using the OAuthBase.cs. 
I would like to know how/where can i Include the "scope" when trying to the 
signature using the GenerateSignature method.

Thanks,

This is the Google's example:

POST /accounts/OAuthGetRequestToken HTTP/1.1
Host: https://www.google.com
Content-Type: application/x-www-form-urlencoded
Authorization: OAuth
oauth_consumer_key="example.com",
oauth_signature_method="RSA-SHA1",
oauth_signature="wOJIO9A2W5mFwDgiDvZbTSMK%2FPY%3D",
oauth_timestamp="137131200",
oauth_nonce="4572616e48616d6d65724c61686176",
oauth_version="1.0"

scope=http://www.google.com/calendar/feeds http://picasaweb.google.com/data

Original issue reported on code.google.com by gbar...@gmail.com on 17 Nov 2008 at 5:52

GoogleCodeExporter commented 9 years ago
Hi there,

The scope value needs to be passed in as part of the http request post body.  

Once you have created an OAuthRequest object, you call GetResource and can pass 
a
NameValueCollection at this point which should contain the scope name and 
value.  An
example for FireEagle is below.  Where lat and long is passed this is where 
scope
should be passed.

// Update the user's location
            var request = OAuthRequest.Create(
                new Uri("https://fireeagle.yahooapis.com/api/0.1/update"),
                FireEagle.PostService,
                context.Session["request_token"] as IToken,
                context.Session["access_token"] as IToken);

            // Send the location latitude and longitude with the request
            OAuthResponse response = request.GetResource(
                new NameValueCollection()
                {
                    { "lat",
location.Point.Latitude.ToString(CultureInfo.InvariantCulture) },
                    { "lon",
location.Point.Longitude.ToString(CultureInfo.InvariantCulture) }
                });

Hope this helps,

Thanks for using our library.

Chris

Original comment by chris.s....@gmail.com on 19 Nov 2008 at 1:06