diff options
Diffstat (limited to 'src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs')
-rw-r--r-- | src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs | 72 |
1 files changed, 63 insertions, 9 deletions
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs index 4dc3dcc..8edbeed 100644 --- a/src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs +++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs @@ -13,9 +13,34 @@ namespace DotNetOpenAuth.AspNet.Clients { using DotNetOpenAuth.OAuth.ChannelElements; using DotNetOpenAuth.OAuth.Messages; + /// <summary> + /// The dot net open auth web consumer. + /// </summary> public class DotNetOpenAuthWebConsumer : IOAuthWebWorker { + #region Constants and Fields + + /// <summary> + /// The _web consumer. + /// </summary> private readonly WebConsumer _webConsumer; + #endregion + + #region Constructors and Destructors + + /// <summary> + /// Initializes a new instance of the <see cref="DotNetOpenAuthWebConsumer"/> class. + /// </summary> + /// <param name="serviceDescription"> + /// The service description. + /// </param> + /// <param name="tokenManager"> + /// The token manager. + /// </param> + /// <exception cref="ArgumentNullException"> + /// </exception> + /// <exception cref="ArgumentNullException"> + /// </exception> public DotNetOpenAuthWebConsumer(ServiceProviderDescription serviceDescription, IConsumerTokenManager tokenManager) { if (serviceDescription == null) { throw new ArgumentNullException("consumer"); @@ -25,21 +50,50 @@ namespace DotNetOpenAuth.AspNet.Clients { throw new ArgumentNullException("tokenManager"); } - _webConsumer = new WebConsumer(serviceDescription, tokenManager); + this._webConsumer = new WebConsumer(serviceDescription, tokenManager); } - public void RequestAuthentication(Uri callback) { - var redirectParameters = new Dictionary<string, string>() { { "force_login", "false" } }; - UserAuthorizationRequest request = _webConsumer.PrepareRequestUserAuthorization(callback, null, redirectParameters); - _webConsumer.Channel.PrepareResponse(request).Send(); + #endregion + + #region Public Methods and Operators + + /// <summary> + /// The prepare authorized request. + /// </summary> + /// <param name="profileEndpoint"> + /// The profile endpoint. + /// </param> + /// <param name="accessToken"> + /// The access token. + /// </param> + /// <returns> + /// </returns> + public HttpWebRequest PrepareAuthorizedRequest(MessageReceivingEndpoint profileEndpoint, string accessToken) { + return this._webConsumer.PrepareAuthorizedRequest(profileEndpoint, accessToken); } + /// <summary> + /// The process user authorization. + /// </summary> + /// <returns> + /// </returns> public AuthorizedTokenResponse ProcessUserAuthorization() { - return _webConsumer.ProcessUserAuthorization(); + return this._webConsumer.ProcessUserAuthorization(); } - public HttpWebRequest PrepareAuthorizedRequest(MessageReceivingEndpoint profileEndpoint, string accessToken) { - return _webConsumer.PrepareAuthorizedRequest(profileEndpoint, accessToken); + /// <summary> + /// The request authentication. + /// </summary> + /// <param name="callback"> + /// The callback. + /// </param> + public void RequestAuthentication(Uri callback) { + var redirectParameters = new Dictionary<string, string> { { "force_login", "false" } }; + UserAuthorizationRequest request = this._webConsumer.PrepareRequestUserAuthorization( + callback, null, redirectParameters); + this._webConsumer.Channel.PrepareResponse(request).Send(); } + + #endregion } -}
\ No newline at end of file +} |