diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-04-19 20:58:49 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-04-19 20:58:49 -0700 |
commit | c0e019b7ff53df92f76b325d28a931b9036ab73a (patch) | |
tree | 788bfe014785d32b64c136c6c66d372a68b9cdd4 /src/DotNetOpenAuth.Core/Messaging/Channel.cs | |
parent | 548147a67be56f046a7d4515d61a8210d78677de (diff) | |
download | DotNetOpenAuth-c0e019b7ff53df92f76b325d28a931b9036ab73a.zip DotNetOpenAuth-c0e019b7ff53df92f76b325d28a931b9036ab73a.tar.gz DotNetOpenAuth-c0e019b7ff53df92f76b325d28a931b9036ab73a.tar.bz2 |
Fixed HTTP Basic authentication for OAuth 2 clients so that it actually works in the sample.
Diffstat (limited to 'src/DotNetOpenAuth.Core/Messaging/Channel.cs')
-rw-r--r-- | src/DotNetOpenAuth.Core/Messaging/Channel.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/Channel.cs b/src/DotNetOpenAuth.Core/Messaging/Channel.cs index fbcb3d6..235c41b 100644 --- a/src/DotNetOpenAuth.Core/Messaging/Channel.cs +++ b/src/DotNetOpenAuth.Core/Messaging/Channel.cs @@ -1097,6 +1097,7 @@ namespace DotNetOpenAuth.Messaging { UriBuilder builder = new UriBuilder(requestMessage.Recipient); MessagingUtilities.AppendQueryArgs(builder, fields); HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(builder.Uri); + this.PrepareHttpWebRequest(httpRequest); return httpRequest; } @@ -1137,6 +1138,7 @@ namespace DotNetOpenAuth.Messaging { var fields = messageAccessor.Serialize(); var httpRequest = (HttpWebRequest)WebRequest.Create(requestMessage.Recipient); + this.PrepareHttpWebRequest(httpRequest); httpRequest.CachePolicy = this.CachePolicy; httpRequest.Method = "POST"; @@ -1314,6 +1316,14 @@ namespace DotNetOpenAuth.Messaging { } /// <summary> + /// Performs additional processing on an outgoing web request before it is sent to the remote server. + /// </summary> + /// <param name="request">The request.</param> + protected virtual void PrepareHttpWebRequest(HttpWebRequest request) { + Requires.NotNull(request, "request"); + } + + /// <summary> /// Customizes the binding element order for outgoing and incoming messages. /// </summary> /// <param name="outgoingOrder">The outgoing order.</param> |