Inheritance: IAuthenticator
		public static OAuth1Authenticator ForRequestToken(string consumerKey, string consumerSecret)
		{
			var authenticator = new OAuth1Authenticator
									{
										ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader,
										SignatureMethod = OAuthSignatureMethod.HmacSha1,
										SignatureTreatment = OAuthSignatureTreatment.Escaped,
										ConsumerKey = consumerKey,
										ConsumerSecret = consumerSecret,
                                        Type = OAuthType.RequestToken
									};
			return authenticator;
		}
Esempio n. 2
0
 public static OAuth1Authenticator ForProtectedResource(string consumerKey, string consumerSecret, string accessToken, string accessTokenSecret)
 {
     var authenticator = new OAuth1Authenticator
     {
         Type = OAuthType.ProtectedResource,
         ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader,
         SignatureMethod = OAuthSignatureMethod.HmacSha1,
         SignatureTreatment = OAuthSignatureTreatment.Escaped,
         ConsumerKey = consumerKey,
         ConsumerSecret = consumerSecret,
         Token = accessToken,
         TokenSecret = accessTokenSecret
     };
     return authenticator;
 }
Esempio n. 3
0
 public static OAuth1Authenticator ForClientAuthentication(string consumerKey, string consumerSecret, string username, string password)
 {
     var authenticator = new OAuth1Authenticator
     {
         ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader,
         SignatureMethod = OAuthSignatureMethod.HmacSha1,
         SignatureTreatment = OAuthSignatureTreatment.Escaped,
         ConsumerKey = consumerKey,
         ConsumerSecret = consumerSecret,
         ClientUsername = username,
         ClientPassword = password,
         Type = OAuthType.ClientAuthentication
     };
     return authenticator;
 }
Esempio n. 4
0
        public static OAuth1Authenticator ForAccessToken(string consumerKey, string consumerSecret, string token,
            string tokenSecret, OAuthSignatureMethod signatureMethod = OAuthSignatureMethod.HmacSha1)
        {
            OAuth1Authenticator authenticator = new OAuth1Authenticator
                                                {
                                                    ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader,
                                                    SignatureMethod = signatureMethod,
                                                    SignatureTreatment = OAuthSignatureTreatment.Escaped,
                                                    ConsumerKey = consumerKey,
                                                    ConsumerSecret = consumerSecret,
                                                    Token = token,
                                                    TokenSecret = tokenSecret,
                                                    Type = OAuthType.AccessToken
                                                };

            return authenticator;
        }