diff options
Diffstat (limited to 'src/DotNetOpenAuth.AspNet/Clients/OAuth2/WindowsLiveClient.cs')
-rw-r--r-- | src/DotNetOpenAuth.AspNet/Clients/OAuth2/WindowsLiveClient.cs | 18 |
1 files changed, 18 insertions, 0 deletions
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)); |