title: Etsy oauth authentication c# RestSharp
body: <p>I'm trying to do the sample Authorized Request (or anything with Etsy's api that requires authentication) given in their <a href="https://www.etsy.com/developers/documentation/getting_started/oauth#section_making_an_authorized_request_to_the_api" rel="nofollow noreferrer">documentation</a>. The response I get is "oauth_problem=token_rejected".</p>
  
  <p>I used <a href="https://stackoverflow.com/questions/18875889/access-etsy-api-oauth-using-c-sharp-restsharp?rq=1">this SO answer</a> along with the <a href="http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs" rel="nofollow noreferrer">OAuth base</a> that <a href="https://stackoverflow.com/users/2791959/bensharper">benSharper</a> linked to.</p>
  
  <p>I've looked at <a href="https://groups.google.com/forum/#!topic/etsy-api-v2/pSLS2I1-9dA" rel="nofollow noreferrer">this</a> and <a href="https://github.com/ddo/oauth-1.0a/issues/10" rel="nofollow noreferrer">this</a>, and others. One of them used <code>https://sandbox.https://openapi.etsy.com/v2</code> and when I tried that, the exception was "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel." I deployed to my server (which is https) and still the same response.</p>
  
  <p>Just can't seem to make it work. What am I missing?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>public class AuthorizedRequestHelper
      {
          string baseUrl = "https://openapi.etsy.com/v2";
          string relativePath = "/oauth/scopes";
          string oauth_consumer_key = "xxx";
          string consumerSecret = "xxx";
          string oauth_token = "xxx";
          string oauth_token_secret = "xxx";
  
          public void test()
          {
              var restClient = new RestClient(baseUrl);
              OAuthBase oAuth = new OAuthBase();
  
              string nonce = oAuth.GenerateNonce();
              string timeStamp = oAuth.GenerateTimeStamp();
              string normalizedUrl;
              string normalizedRequestParameters;
  
              string sig = oAuth.GenerateSignature(new Uri(baseUrl + relativePath), oauth_consumer_key, consumerSecret, oauth_token, oauth_token_secret, "GET", timeStamp, nonce, out normalizedUrl, out normalizedRequestParameters);
  
  
              var request = new RestRequest(relativePath);
              request.Resource = string.Format(relativePath);
              request.Method = Method.GET;
  
              request.AddParameter("oauth_consumer_key", oauth_consumer_key);
              request.AddParameter("oauth_token", oauth_token);
              request.AddParameter("oauth_nonce", nonce);
              request.AddParameter("oauth_timestamp", timeStamp);
              request.AddParameter("oauth_signature_method", "HMAC-SHA1");
              request.AddParameter("oauth_version", "1.0");
              request.AddParameter("oauth_signature", sig);
  
              IRestResponse irestResponse = restClient.Execute(request);
              var content = irestResponse.Content;
              // content = oauth_problem=token_rejected
          }
      }  
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>