Esempio n. 1
0
        public void InitTests()
        {
            oAuth = new OAuth();

            // No security vulnerability - credentials are from Twitter's Creating a signature documentation: https://dev.twitter.com/docs/auth/creating-signature
            parameters =
                new Dictionary<string, string>
                {
                    {StatusKey, "Hello Ladies + Gentlemen, a signed OAuth request!"},
                    {EntitiesKey, "true"},
                    {"oauth_consumer_key", "xvz1evFS4wEEPTGEFPHBog" },
                    {"oauth_nonce", "kYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg" },
                    {"oauth_signature_method", "HMAC-SHA1" },
                    {"oauth_timestamp", "1318622958" },
                    {"oauth_token", "370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb" }, 
                    {"oauth_version", "1.0" }
                };
        }
 public virtual string GetAuthorizationString(string method, string oauthUrl, IDictionary<string, string> parameters)
 {
     string consumerSecret = CredentialStore.ConsumerSecret ?? "";
     string oAuthTokenSecret = CredentialStore.OAuthTokenSecret ?? "";
     string authorizationString =
         new OAuth().GetAuthorizationString(
             method, oauthUrl, parameters, consumerSecret, oAuthTokenSecret);
     return authorizationString;
 }