コード例 #1
0
        /// <summary>
        /// Gets OAuth authorization header.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Make sure that the parameters array contains mulitpart keys if we're dealing with a buggy
        /// OAuth implementation (such as Flickr).
        /// </para>
        /// <para>
        /// These normally shouldn't be included: http://tools.ietf.org/html/rfc5849#section-3.4.1.3.1
        /// </para>
        /// </remarks>
        protected virtual string GetAuthorizationHeader()
        {
            var ps = new Dictionary <string, string> (Parameters);

            if (includeMultipartsInSignature)
            {
                foreach (var p in Multiparts)
                {
                    if (!string.IsNullOrEmpty(p.TextData))
                    {
                        ps [p.Name] = p.TextData;
                    }
                }
            }

            return(OAuth1.GetAuthorizationHeader(
                       Method,
                       Url,
                       ps,
                       Account.Properties ["oauth_consumer_key"],
                       Account.Properties ["oauth_consumer_secret"],
                       Account.Properties ["oauth_token"],
                       Account.Properties ["oauth_token_secret"]));
        }