Beispiel #1
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;
 }
Beispiel #2
0
 public static OAuth1Authenticator ForAccessToken(string consumerKey, string consumerSecret, string token, string tokenSecret)
 {
     var authenticator = new OAuth1Authenticator
     {
         ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader,
         SignatureMethod = OAuthSignatureMethod.HmacSha1,
         SignatureTreatment = OAuthSignatureTreatment.Escaped,
         ConsumerKey = consumerKey,
         ConsumerSecret = consumerSecret,
         Token = token,
         TokenSecret = tokenSecret,
         Type = OAuthType.AccessToken
     };
     return authenticator;
 }
Beispiel #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;
 }