//-----------------------------------------------------------------------
//
// Copyright (c) Andrew Arnott. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OAuth {
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DotNetOpenAuth.Messaging;
///
/// A delegating HTTP handler that signs outgoing HTTP requests
/// with the PLAINTEXT signature.
///
public class OAuth1PlainTextMessageHandler : OAuth1HttpMessageHandlerBase {
///
/// Gets the signature method to include in the oauth_signature_method parameter.
///
///
/// The signature method.
///
protected override string SignatureMethod {
get { return "PLAINTEXT"; }
}
///
/// Calculates the signature for the specified buffer.
///
/// The payload to calculate the signature for.
///
/// The signature.
///
/// Always thrown.
protected override byte[] Sign(byte[] signedPayload) {
throw new NotImplementedException();
}
///
/// Gets the OAuth 1.0 signature to apply to the specified request.
///
/// The outbound HTTP request.
/// The oauth parameters.
///
/// The value for the "oauth_signature" parameter.
///
protected override string GetSignature(System.Net.Http.HttpRequestMessage request, NameValueCollection oauthParameters) {
var builder = new StringBuilder();
builder.Append(MessagingUtilities.EscapeUriDataStringRfc3986(this.ConsumerSecret));
builder.Append("&");
builder.Append(MessagingUtilities.EscapeUriDataStringRfc3986(this.AccessTokenSecret));
return builder.ToString();
}
}
}