“ Auth-010 Access令牌提供的代币无效或已过期”。如何解决此错误?

发布于 2025-02-08 19:20:38 字数 561 浏览 1 评论 0原文

我有四个(本质上相同的)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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你怎么这么可爱啊 2025-02-15 19:20:38

答案最初由OP发布到问题:

我弄清楚了,但希望这对别人有帮助。我是
使用错误的URL获取2腿令牌。
“/authentication/v1/authenticate”获得2腿令牌,
“/authentication/v1/getToken”获得了3尾令牌。一些API调用
需要2腿令牌,有些需要3尾令牌(有些
也会服用)。并不总是需要什么。

Answer originally posted to question by OP:

I figured it out, but hopefully this will help someone else. I was
using the wrong URL to get the 2-legged token.
"/authentication/v1/authenticate" gets the 2-legged token,
"/authentication/v1/gettoken" gets the 3-legged token. Some API calls
require a 2-legged token, and some require a 3-legged token (and some
will take either). It is not always obvious what is required.

落花浅忆 2025-02-15 19:20:38

看起来您自己重新解决了问题,但仅仅是仅供参考。每个端点都有一个必需的身份验证上下文。它将有助于了解什么样的OAuth工作流程并访问您对此端点的需求。例如,

但是,某些端点支持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.
    enter image description here

  • GET issues of BIM360 Issues API accepts 3LO access toke only
    enter image description here

However, some endpoints support both 2LO and 3LO. e.g. GET Hubs of Data Management API.

enter image description here

We can find the exaplaination under Forge OAth API documentation here.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文