2016-04-22 251 views
0

這裏是我使用OAuth的庫:https://github.com/danielcrenna/oauthQuickBooks的OAuth的API(401)未經授權

我得到令牌,祕密和realmId(公司ID)就好了,並將它們存儲,但是當我去做一個簡單的請求,我得到(401)未經授權。

下面是我使用的代碼:

 var rq = new OAuthRequest 
     { 
      Method = "GET", 
      Type = OAuthRequestType.ProtectedResource, 
      SignatureMethod = OAuthSignatureMethod.HmacSha1, 
      ConsumerKey = ConfigurationManager.AppSettings["ConsumerKey"], 
      ConsumerSecret = ConfigurationManager.AppSettings["ConsumerSecret"], 
      Token = requestToken, 
      TokenSecret = requestTokenSecret, 
      RequestUrl = "https://quickbooks.api.intuit.com/v3/company/" + realmId + "/query?query=select%20%2A%20from%20CompanyInfo&minorversion=4", 
      Version = "1.0", 
     }; 

並且認證標題:

OAuth oauth_consumer_key="****",oauth_nonce="6su4ljd2is5bxns4",oauth_signature="0taFXiouzOkpK258tz%2Fc%2F2fVQ0c%3D",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1461339515",oauth_token="****",oauth_version="1.0" 

我找不到在錯誤的任何其他細節,我剛開始「401未經授權「。我如何獲得此請求?

回答

相關問題