summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-01-13 17:00:58 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2013-01-13 17:00:58 -0800
commit56916052cb61a48a85c5920f266766cfc937ece4 (patch)
tree372b8aeeae54e3bf268a482272819d17b3ab048d /src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs
parente117dedb1c2de355dae0bb3eedaa7b06deb0770e (diff)
downloadDotNetOpenAuth-56916052cb61a48a85c5920f266766cfc937ece4.zip
DotNetOpenAuth-56916052cb61a48a85c5920f266766cfc937ece4.tar.gz
DotNetOpenAuth-56916052cb61a48a85c5920f266766cfc937ece4.tar.bz2
DNOA.OAuth project now builds.
Diffstat (limited to 'src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs
index 780afdc..4316333 100644
--- a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs
+++ b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs
@@ -12,6 +12,8 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
using System.Globalization;
using System.Linq;
using System.Text;
+ using System.Threading;
+ using System.Threading.Tasks;
using System.Web;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
@@ -83,7 +85,7 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
/// The protections (if any) that this binding element applied to the message.
/// Null if this binding element did not even apply to this binding element.
/// </returns>
- public MessageProtections? ProcessOutgoingMessage(IProtocolMessage message) {
+ public async Task<MessageProtections?> ProcessOutgoingMessageAsync(IProtocolMessage message, CancellationToken cancellationToken) {
var signedMessage = message as ITamperResistantOAuthMessage;
if (signedMessage != null && this.IsMessageApplicable(signedMessage)) {
if (this.SignatureCallback != null) {
@@ -110,7 +112,7 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
/// Null if this binding element did not even apply to this binding element.
/// </returns>
/// <exception cref="InvalidSignatureException">Thrown if the signature is invalid.</exception>
- public MessageProtections? ProcessIncomingMessage(IProtocolMessage message) {
+ public async Task<MessageProtections?> ProcessIncomingMessageAsync(IProtocolMessage message, CancellationToken cancellationToken) {
var signedMessage = message as ITamperResistantOAuthMessage;
if (signedMessage != null && this.IsMessageApplicable(signedMessage)) {
Logger.Bindings.DebugFormat("Verifying incoming {0} message signature of: {1}", message.GetType().Name, signedMessage.Signature);
@@ -151,13 +153,13 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
[SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Unavoidable")]
internal static string ConstructSignatureBaseString(ITamperResistantOAuthMessage message, MessageDictionary messageDictionary) {
Requires.NotNull(message, "message");
- Requires.NotNullOrEmpty(message.HttpMethod, "message.HttpMethod");
+ Requires.NotNull(message.HttpMethod, "message.HttpMethod");
Requires.NotNull(messageDictionary, "messageDictionary");
ErrorUtilities.VerifyInternal(messageDictionary.Message == message, "Message references are not equal.");
List<string> signatureBaseStringElements = new List<string>(3);
- signatureBaseStringElements.Add(message.HttpMethod.ToUpperInvariant());
+ signatureBaseStringElements.Add(message.HttpMethod.ToString().ToUpperInvariant());
// For multipart POST messages, only include the message parts that are NOT
// in the POST entity (those parts that may appear in an OAuth authorization header).