title: OAuth RequestToken returning 403
body: <p>I'm trying to implement the OAuth using a simple class but I'm getting an error </p>
  
  <pre><code>public OAuthResponse AcquireRequestToken(string uri, string method) 
  { 
      NewRequest(); 
      var authzHeader = GetAuthorizationHeader(uri, method); 
  
      // prepare the token request 
      var request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(uri); 
      request.Headers.Add("User-Agent", "MyAppId/1.0.3 +http://example.pt/"); 
      request.Headers.Add("Authorization", authzHeader); 
      request.Method = method; 
      request.ContentLength = 0; 
  
      using (var response = (System.Net.HttpWebResponse)request.GetResponse()) 
      { 
          using (var reader = new System.IO.StreamReader(response.GetResponseStream())) 
          { 
              var r = new OAuthResponse(reader.ReadToEnd()); 
              this["token"] = r["oauth_token"]; 
  
              // Sometimes the request_token URL gives us an access token, 
              // with no user interaction required. Eg, when prior approval 
              // has already been granted. 
              try 
              { 
                  if (r["oauth_token_secret"] != null) 
                  this["token_secret"] = r["oauth_token_secret"]; 
              } 
              catch { } 
              return r; 
          } 
      } 
  } 
  </code></pre>
  
  <p>The error it's in this line</p>
  
  <pre><code>var response = (System.Net.HttpWebResponse)request.GetResponse()
  </code></pre>
  
  <p>and the error is </p>
  
  <blockquote>
    <p>Aditional information: The remote server returned an error: (403)
    Forbidden.</p>
  </blockquote>
  
  <p>Any Help? Here is the full OAuth class <a href="https://cropperplugins.codeplex.com/SourceControl/changeset/view/65377#1710422" rel="nofollow">https://cropperplugins.codeplex.com/SourceControl/changeset/view/65377#1710422</a></p>
  
  <p>Also the service that i'm trying to access it's Discogs.com API DOCS: <a href="http://www.discogs.com/developers" rel="nofollow">http://www.discogs.com/developers</a></p>
  
  <h2>UPDATE 1</h2>
  
  <p>I've added the user-agent header the discogs Staff said it was needed but now I have another error on the User-Agent line  <code>request.Headers.Add("User-Agent", "BandFollowerWD/1.0.3 +http://pcdev.pt/");</code> </p>
  
  <pre><code>The 'User-Agent' header must be modified with the appropriate property or method.
  </code></pre>