问题描述
我正在使用Intuit API开发具有QuickBooks集成的.NET(C#)应用程序.我用不同的QuickBooks数据创建了两个Intuit帐户(分别为A和B).
I am developing a .NET(C#) application with QuickBooks integration using Intuit API. I’ve created 2 Intuit Accounts, say A and B, with different QuickBooks data.
我连接并授权Intuit帐户A,并在我的应用程序中创建一个客户C1.然后,我连接并授权B并在我的应用程序中创建另一个客户端C2.至此,一切正常.创建客户端时,我将oAuth信息(如访问令牌,访问令牌密钥,密钥等)保存在数据库中.并在我要编辑特定客户端时获取相应的信息.
I connect and authorize Intuit account A and create a Client, C1, with same in my application. Then I connect and authorize B and create another Client, C2, in my application. Till this point everything works fine. I save the oAuth information like access token, access token secret, key etc. in database when I create the Clients. And fetch the respective information when I want to edit a particular Client.
(记住创建C2时我的应用程序是上次授权的Intuit帐户B)
(Remember my application was last authorized Intuit Account B when C2 was created)
现在,此刻,如果我转到与Intuit帐户A连接的客户端C1,并尝试获取快速簿数据,而无需通过默认的连接和使用"connect to intuit"按钮授权intuit的过程,它会给出我出现"Unauthorized-401"错误,即使我提供的oAuth信息(如访问令牌,机密信息,密钥等)也已在创建客户端期间保存在本地数据库中.我启动API方法来获取数据后,QuickBooks就会引发错误.
Now, at this moment, if I go to Client C1 which is connected with Intuit Account A, and try to fetch quickbooks data, without going through default connect and authorize process of intuit using "connect to intuit" button, it gives me "Unauthorized-401" Error, even though I am providing oAuth information like access token, secret, key etc. which was saved in local database during Client creation. QuickBooks throws error as soon as I fire API method to fetch data.
我不希望我的应用程序每次尝试从其他Intuit帐户中获取数据时都手动连接并授权Intuit帐户流程,因为存在自动执行的后台作业,该作业每24小时就会同步每个客户的QuickBooks数据.无法对该工作进行手动授权.
I don’t want my application to manually connect and authorize Intuit account process every time it tries to fetch data from a different Intuit account, As there is an automated background job which sync every Client’s QuickBooks data after every 24 hrs. It is not possible to manually authorize the same with that job.
我在这里想念的是什么?我该怎么办?我需要购买任何合作伙伴许可证或其他东西吗?
What I am missing here? What should I do? Do I need to purchase any Partner License or something ?
推荐答案
对于公司文件的主管理员,除非您的应用将Connect to Quickbooks(C2QB)用于同一领域,否则令牌不会无效.只有这样才能使令牌无效.请检查是否将令牌保存在某个临时存储区中,而不要删除/清除它可能导致令牌过期的临时文件.由于两个QBO帐户/领域A和B与管理员(C1和C2)不相关,因此没有理由为B生成oauth令牌可能导致A的令牌过期.
For a master admin of a company file, tokens cannot be invalidated unless Connect to Quickbooks(C2QB) is used for the same realm by your app. Only this can render the tokens invalid.Please check if you are saving the tokens in some temp store and not deleting/cleaning it which can cause expiring of tokens.Since, the two QBO accounts/realms A and B and the admins(C1 and C2) are not related, there is no reason that generating the oauth tokens for B could cause tokens to expire for A.
这篇关于获得"Unauthorized-401".通过Intuit API访问quickBooks数据时.NET中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!