“ Auth-010 Access令牌提供的代币无效或已过期”。如何解决此错误?
我有四个(本质上相同的)Forge应用程序,但每个应用程序都有一个单独的回调服务器(我使用的是相同使用)。不幸的是,这四个中的一个生成了上述错误。我的代码在所有四个方面均与用户/项目相同(我正在通过每个服务器测试相同的BIM 360项目。所有四个应用程序均具有“ BIM 360帐户管理”(BIM360 API)和“文档管理”(文档管理API)访问。 这四个似乎都可以完美地生成2和3腿的OAuth代币(2LT/3LT),并使用3LT进行初始调用以获取HUBS(数据管理API)。从那里开始,三个应用程序成功拨打了我所有的其他电话。但是,第四台服务器(当然)在下一个呼叫获取项目(HQ/V1/Account/:Account_ID/Projects,BIM360 API)的情况下立即失败,并带有上述错误。呼叫是立即的,因此无法过期;我也无法理解它是无效的。
在过去的几个月中,我遇到了几次相同的错误。但是我不记得一个具体的修复程序。代码相同;会员访问是相同的(因为它是同一会员); 3lt Oauth显然在起作用,因为我能够进行轮毂呼叫。我以前从未在2LT上遇到任何麻烦,但是在这种情况下,我无法验证它仍然很好。在服务器上进行故障排除将是一个挑战。
任何建议都将不胜感激。谢谢!
I have four (essentially identical) Forge apps, but each with a separate callback server, (which I am using identically). Unfortunately, one of the four generates the above error. My code is identical for all four, as are the users/projects (I am testing the same BIM 360 project & members via each server). All four Apps have "BIM 360 Account Administration" (BIM360 API) and "Document Management" (Document Management API) access.
All four seem to work perfectly for generating the 2- and 3-legged OAuth tokens (2LT/3LT), and making the initial call to Get Hubs (Data Management API) using the 3LT. From there, three apps succeed in making all of my other calls; however the fourth server (Production, of course) fails immediately on the next call to Get Projects (hq/v1/accounts/:account_id/projects, BIM360 API), with the above error. The call is immediate, so it can't have expired; nor can I understand how it is invalid.
I have run into this same error several times in the last few months; but I can't recall a specific fix. Code is the same; member access is the same (because it's the same member); 3LT OAuth is clearly working because I am able to make the Hubs call; I've never had any trouble before with the 2LT, but I can't verify that it's still good in this case. Troubleshooting on the server is going to be a challenge.
Any suggestions would be highly appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案最初由OP发布到问题:
Answer originally posted to question by OP:
看起来您自己重新解决了问题,但仅仅是仅供参考。每个端点都有一个必需的
身份验证上下文
。它将有助于了解什么样的OAuth工作流程并访问您对此端点的需求。例如,获得项目 BIM360 Admin API仅接受2lo访问令牌。

获得BIM360问题的问题 API仅接受3lo访问toke

但是,某些端点支持2LO和3LO。例如获取数据管理API的枢纽。
我们可以在Forge Oath otge opi文档下找到exaplaination 在这里。
Looks like you reolved the issue yourself, but just FYI. Each endpoint has a required
Authentication Context
. It will help understnad what kind of OAuth workflow and access token your need for calling this endpoint. For example,GET projects of BIM360 Admin API accept 2LO access token only.

GET issues of BIM360 Issues API accepts 3LO access toke only

However, some endpoints support both 2LO and 3LO. e.g. GET Hubs of Data Management API.
We can find the exaplaination under Forge OAth API documentation here.