Beispiel #1
0
        public void ShouldGenerateSignatureForFlickr()
        {
            //given
            OAuth.Net.Common.ISigningProvider provider      = new OAuth.Net.Components.HmacSha1SigningProvider();
            OAuth.Net.Common.INonceProvider   nonceProvider = new OAuth.Net.Components.GuidNonceProvider();
            DateTime        time       = DateTime.Now;
            OAuthParameters parameters = new OAuthParameters()
            {
                Nonce           = nonceProvider.GenerateNonce(),
                SignatureMethod = "HMAC-SHA1",
                Timestamp       = "1316657628",
                Version         = "1.0",
                Callback        = "http://www.wackylabs.net/oauth/test",
                ConsumerKey     = "768fe946d252b119746fda82e1599980"
            };
            string       baseString     = SignatureBase.Create("GET", new Uri("http://www.flickr.com/services/oauth/request_token"), parameters);
            string       consumerSecret = "1a3c208e172d3edc";
            string       tokenSecret    = string.Empty;
            OAuthService testee         = new OAuthService();
            //when
            string result = provider.ComputeSignature(baseString, consumerSecret, tokenSecret);

            //then
            Assert.AreEqual(expected, result);
        }
Beispiel #2
0
 public string GenerateSignature(string baseString, string consumerSecret, string tokenSecret)
 {
     OAuth.Net.Common.ISigningProvider provider = new OAuth.Net.Components.HmacSha1SigningProvider();
     return(provider.ComputeSignature(baseString, consumerSecret, tokenSecret));
 }