diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2013-05-26 10:00:08 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2013-05-26 10:00:08 -0700 |
commit | 275339ef4c74c65545e0e3abaf08b18cab3b4639 (patch) | |
tree | d4eece1833e0c1285b57b0cea633429690af40b2 /src | |
parent | ced7d307a7801de9e8fed39c8d470b525e8b94f1 (diff) | |
parent | f6b3cbc49c0b9bc9916d90f36e3371a252787ddb (diff) | |
download | DotNetOpenAuth-275339ef4c74c65545e0e3abaf08b18cab3b4639.zip DotNetOpenAuth-275339ef4c74c65545e0e3abaf08b18cab3b4639.tar.gz DotNetOpenAuth-275339ef4c74c65545e0e3abaf08b18cab3b4639.tar.bz2 |
Adds ctor overload with scope parameter to FacebookClient.
Closes #272
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs index a8c121d..f79b965 100644 --- a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs +++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs @@ -39,12 +39,18 @@ namespace DotNetOpenAuth.AspNet.Clients { /// </summary> private readonly string appSecret; + /// <summary> + /// The scope. + /// </summary> + private readonly string scope; + #endregion #region Constructors and Destructors /// <summary> - /// Initializes a new instance of the <see cref="FacebookClient"/> class. + /// Initializes a new instance of the <see cref="FacebookClient"/> class + /// with "email" as the scope. /// </summary> /// <param name="appId"> /// The app id. @@ -53,12 +59,30 @@ namespace DotNetOpenAuth.AspNet.Clients { /// The app secret. /// </param> public FacebookClient(string appId, string appSecret) + : this(appId, appSecret, "email") { + } + + /// <summary> + /// Initializes a new instance of the <see cref="FacebookClient"/> class. + /// </summary> + /// <param name="appId"> + /// The app id. + /// </param> + /// <param name="appSecret"> + /// The app secret. + /// </param> + /// <param name="scope"> + /// The scope of authorization to request when authenticating with Facebook. The default is "email". + /// </param> + public FacebookClient(string appId, string appSecret, string scope) : base("facebook") { Requires.NotNullOrEmpty(appId, "appId"); Requires.NotNullOrEmpty(appSecret, "appSecret"); + Requires.NotNullOrEmpty(scope, "scope"); this.appId = appId; this.appSecret = appSecret; + this.scope = scope; } #endregion @@ -79,7 +103,7 @@ namespace DotNetOpenAuth.AspNet.Clients { new Dictionary<string, string> { { "client_id", this.appId }, { "redirect_uri", returnUrl.AbsoluteUri }, - { "scope", "email" }, + { "scope", this.scope }, }); return builder.Uri; } |