Esempio n. 1
0
        public static OAuthRequest ForRequestToken(string consumerKey, string consumerSecret)
        {
            var credentials = new OAuthRequest
            {
                Method             = "GET",
                Type               = OAuthRequestType.RequestToken,
                SignatureMethod    = OAuthSignatureMethod.HmacSha1,
                SignatureTreatment = OAuthSignatureTreatment.Escaped,
                ConsumerKey        = consumerKey,
                ConsumerSecret     = consumerSecret
            };

            return(credentials);
        }
Esempio n. 2
0
        public static OAuthRequest ForProtectedResource(string method, string consumerKey, string consumerSecret, string accessToken, string accessTokenSecret)
        {
            var credentials = new OAuthRequest
            {
                Method             = method ?? "GET",
                Type               = OAuthRequestType.ProtectedResource,
                SignatureMethod    = OAuthSignatureMethod.HmacSha1,
                SignatureTreatment = OAuthSignatureTreatment.Escaped,
                ConsumerKey        = consumerKey,
                ConsumerSecret     = consumerSecret,
                Token              = accessToken,
                TokenSecret        = accessTokenSecret
            };

            return(credentials);
        }
Esempio n. 3
0
        public static OAuthRequest ForClientAuthentication(string consumerKey, string consumerSecret, string username, string password)
        {
            var credentials = new OAuthRequest
            {
                Method             = "GET",
                Type               = OAuthRequestType.ClientAuthentication,
                SignatureMethod    = OAuthSignatureMethod.HmacSha1,
                SignatureTreatment = OAuthSignatureTreatment.Escaped,
                ConsumerKey        = consumerKey,
                ConsumerSecret     = consumerSecret,
                ClientUsername     = username,
                ClientPassword     = password
            };

            return(credentials);
        }