diff options
7 files changed, 126 insertions, 3 deletions
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth/LinkedInClient.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth/LinkedInClient.cs index 702501a..8f49c80 100644 --- a/src/DotNetOpenAuth.AspNet/Clients/OAuth/LinkedInClient.cs +++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth/LinkedInClient.cs @@ -19,6 +19,9 @@ namespace DotNetOpenAuth.AspNet.Clients { /// Represents LinkedIn authentication client. /// </summary> public sealed class LinkedInClient : OAuthClient { + /// <summary> + /// Describes the OAuth service provider endpoints for LinkedIn. + /// </summary> public static readonly ServiceProviderDescription LinkedInServiceDescription = new ServiceProviderDescription { RequestTokenEndpoint = new MessageReceivingEndpoint("https://api.linkedin.com/uas/oauth/requestToken", HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest), UserAuthorizationEndpoint = new MessageReceivingEndpoint("https://www.linkedin.com/uas/oauth/authenticate", HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest), diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookGraphData.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookGraphData.cs index 17e0acd..80c42b7 100644 --- a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookGraphData.cs +++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookGraphData.cs @@ -19,21 +19,57 @@ namespace DotNetOpenAuth.AspNet.Clients { [DataContract] [EditorBrowsable(EditorBrowsableState.Never)] public class FacebookGraphData { + /// <summary> + /// Gets or sets the id. + /// </summary> + /// <value> + /// The id. + /// </value> [DataMember(Name = "id")] public string Id { get; set; } + /// <summary> + /// Gets or sets the email. + /// </summary> + /// <value> + /// The email. + /// </value> [DataMember(Name = "email")] public string Email { get; set; } + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value> + /// The name. + /// </value> [DataMember(Name = "name")] public string Name { get; set; } + /// <summary> + /// Gets or sets the link. + /// </summary> + /// <value> + /// The link. + /// </value> [DataMember(Name = "link")] public Uri Link { get; set; } + /// <summary> + /// Gets or sets the gender. + /// </summary> + /// <value> + /// The gender. + /// </value> [DataMember(Name = "gender")] public string Gender { get; set; } + /// <summary> + /// Gets or sets the birthday. + /// </summary> + /// <value> + /// The birthday. + /// </value> [DataMember(Name = "birthday")] public string Birthday { get; set; } } diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2AccessTokenData.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2AccessTokenData.cs index 6d9d3a6..d17b452 100644 --- a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2AccessTokenData.cs +++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2AccessTokenData.cs @@ -7,17 +7,44 @@ namespace DotNetOpenAuth.AspNet.Clients { using System.Runtime.Serialization; + /// <summary> + /// Captures the result of an access token request, including an optional refresh token. + /// </summary> [DataContract] public class OAuth2AccessTokenData { + /// <summary> + /// Gets or sets the access token. + /// </summary> + /// <value> + /// The access token. + /// </value> [DataMember(Name = "access_token")] public string AccessToken { get; set; } + /// <summary> + /// Gets or sets the refresh token. + /// </summary> + /// <value> + /// The refresh token. + /// </value> [DataMember(Name = "refresh_token")] public string RefreshToken { get; set; } + /// <summary> + /// Gets or sets the scope. + /// </summary> + /// <value> + /// The scope. + /// </value> [DataMember(Name = "scope")] public string Scope { get; set; } + /// <summary> + /// Gets or sets the type of the token. + /// </summary> + /// <value> + /// The type of the token. + /// </value> [DataMember(Name = "token_type")] public string TokenType { get; set; } } diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs index 319d1d9..7570b4d 100644 --- a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs +++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs @@ -101,11 +101,11 @@ namespace DotNetOpenAuth.AspNet.Clients { } /// <summary> - /// Gets the full url pointing to the login page for this client. The url should include the + /// Gets the full url pointing to the login page for this client. The url should include the /// specified return url so that when the login completes, user is redirected back to that url. /// </summary> /// <param name="returnUrl">The return URL.</param> - /// <returns></returns> + /// <returns>An absolute URL.</returns> [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Login", Justification = "Login is used more consistently in ASP.Net")] protected abstract Uri GetServiceLoginUrl(Uri returnUrl); @@ -114,7 +114,7 @@ namespace DotNetOpenAuth.AspNet.Clients { /// </summary> /// <param name="returnUrl">The return URL.</param> /// <param name="authorizationCode">The authorization code.</param> - /// <returns></returns> + /// <returns>The access token</returns> protected abstract string QueryAccessToken(Uri returnUrl, string authorizationCode); /// <summary> diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/WindowsLiveClient.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/WindowsLiveClient.cs index e592c05..35bd490 100644 --- a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/WindowsLiveClient.cs +++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/WindowsLiveClient.cs @@ -32,6 +32,11 @@ namespace DotNetOpenAuth.AspNet.Clients { _appSecret = appSecret; } + /// <summary> + /// Gets the full url pointing to the login page for this client. The url should include the + /// specified return url so that when the login completes, user is redirected back to that url. + /// </summary> + /// <param name="returnUrl">The return URL.</param> protected override Uri GetServiceLoginUrl(Uri returnUrl) { var builder = new UriBuilder(AuthorizationEndpoint); MessagingUtilities.AppendQueryArgs(builder, @@ -46,6 +51,11 @@ namespace DotNetOpenAuth.AspNet.Clients { return builder.Uri; } + /// <summary> + /// Queries the access token from the specified authorization code. + /// </summary> + /// <param name="returnUrl">The return URL.</param> + /// <param name="authorizationCode">The authorization code.</param> protected override string QueryAccessToken(Uri returnUrl, string authorizationCode) { var builder = new StringBuilder(); builder.AppendFormat("client_id={0}", _appId); @@ -78,6 +88,14 @@ namespace DotNetOpenAuth.AspNet.Clients { return null; } + /// <summary> + /// Given the access token, gets the logged-in user's data. The returned dictionary must include + /// two keys 'id', and 'username'. + /// </summary> + /// <param name="accessToken">The access token of the current user.</param> + /// <returns> + /// A dictionary contains key-value pairs of user data + /// </returns> protected override IDictionary<string, string> GetUserData(string accessToken) { WindowsLiveUserData graph; var request = WebRequest.Create("https://apis.live.net/v5.0/me?access_token=" + Uri.EscapeDataString(accessToken)); diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/WindowsLiveUserData.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/WindowsLiveUserData.cs index 6050aae..5c16269 100644 --- a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/WindowsLiveUserData.cs +++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/WindowsLiveUserData.cs @@ -19,21 +19,57 @@ namespace DotNetOpenAuth.AspNet.Clients { [DataContract] [EditorBrowsable(EditorBrowsableState.Never)] public class WindowsLiveUserData { + /// <summary> + /// Gets or sets the id. + /// </summary> + /// <value> + /// The id. + /// </value> [DataMember(Name = "id")] public string Id { get; set; } + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value> + /// The name. + /// </value> [DataMember(Name = "name")] public string Name { get; set; } + /// <summary> + /// Gets or sets the link. + /// </summary> + /// <value> + /// The link. + /// </value> [DataMember(Name = "link")] public Uri Link { get; set; } + /// <summary> + /// Gets or sets the gender. + /// </summary> + /// <value> + /// The gender. + /// </value> [DataMember(Name = "gender")] public string Gender { get; set; } + /// <summary> + /// Gets or sets the first name. + /// </summary> + /// <value> + /// The first name. + /// </value> [DataMember(Name = "first_name")] public string FirstName { get; set; } + /// <summary> + /// Gets or sets the last name. + /// </summary> + /// <value> + /// The last name. + /// </value> [DataMember(Name = "last_name")] public string LastName { get; set; } } diff --git a/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs b/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs index 19c1184..1c8d210 100644 --- a/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs +++ b/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs @@ -11,6 +11,9 @@ namespace DotNetOpenAuth.AspNet { using System.Web.Security; using DotNetOpenAuth.AspNet.Resources; + /// <summary> + /// Helper methods for setting and retrieving a custom forms authentication ticket for delegation protocols. + /// </summary> internal static class OpenAuthAuthenticationTicketHelper { private const string OpenAuthCookieToken = "OpenAuth"; |