Permalink
Browse files

[Issue-2] added sample for scope permissions

  • Loading branch information...
1 parent bd2a1b9 commit a29966177530b3aa1e0fd316ef162576141ce671 @bbaia bbaia committed Sep 10, 2012
@@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using System.Collections.Generic;
+using System.Collections.Specialized;
using Spring.Json;
using Spring.Social.OAuth1;
@@ -27,7 +28,9 @@ static void Main(string[] args)
// Authentication using Out-of-band/PIN Code Authentication
Console.Write("Getting request token...");
- OAuthToken oauthToken = linkedInServiceProvider.OAuthOperations.FetchRequestTokenAsync("oob", null).Result;
+ NameValueCollection parameters = new NameValueCollection();
+ //parameters.Add("scope", "r_basicprofile r_emailaddress");
+ OAuthToken oauthToken = linkedInServiceProvider.OAuthOperations.FetchRequestTokenAsync("oob", parameters).Result;
Console.WriteLine("Done");
string authenticateUrl = linkedInServiceProvider.OAuthOperations.BuildAuthorizeUrl(oauthToken.Value, null);
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Mvc;
@@ -30,7 +31,9 @@ public ActionResult Index()
// GET: /LinkedIn/SignIn
public ActionResult SignIn()
{
- OAuthToken requestToken = linkedInProvider.OAuthOperations.FetchRequestTokenAsync("http://localhost/LinkedIn/Callback", null).Result;
+ NameValueCollection parameters = new NameValueCollection();
+ //parameters.Add("scope", "r_basicprofile r_emailaddress");
+ OAuthToken requestToken = linkedInProvider.OAuthOperations.FetchRequestTokenAsync("http://localhost/LinkedIn/Callback", parameters).Result;
Session["RequestToken"] = requestToken;
return Redirect(linkedInProvider.OAuthOperations.BuildAuthenticateUrl(requestToken.Value, null));
@@ -2,6 +2,7 @@
using System.ComponentModel;
using System.IO.IsolatedStorage;
using System.Collections.Generic;
+using Spring.Collections.Specialized;
using Spring.Social.OAuth1;
using Spring.Social.LinkedIn.Api;
@@ -68,7 +69,9 @@ public LinkedInProfile Profile
public void Authenticate()
{
- this.LinkedInServiceProvider.OAuthOperations.FetchRequestTokenAsync(CallbackUrl, null,
+ NameValueCollection parameters = new NameValueCollection();
+ //parameters.Add("scope", "r_basicprofile r_emailaddress");
+ this.LinkedInServiceProvider.OAuthOperations.FetchRequestTokenAsync(CallbackUrl, parameters,
r =>
{
this.requestOAuthToken = r.Response;

0 comments on commit a299661

Please sign in to comment.