summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs28
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;
}