forge.tutorial.viewhubmodels.nodejs Heroku 上的教程 401(未授权)
forge.tutorial.viewhubmodels.nodejs tutorial 401 (Unauthorized) on Heroku
我在 Heroku 上安装了 http://learnforge.autodesk.io tutorial and locally the apps work fine. But when I try to deploy the forge.tutorial.viewhubmodels.nodejs 应用程序,当我尝试登录时出现以下错误:
GET https://forgebcsample.herokuapp.com/api/forge/oauth/token 401 (Unauthorized)
Heroku 仪表板中的 Config Vars 是正确的,我更新了 Forge Developer Portal 上的值,如部署教程中所述。我什至尝试将 FORGE_CLIENT_ID、FORGE_CLIENT_SECRET 和 FORGE_CALLBACK_URL 硬编码到应用程序中,但错误仍然存在。
Heroku 日志:
- 2018-09-07T06:59:41.950470+00:00 heroku[路由器]: at=info method=GET path="/" host=forgebcsample.herokuapp.com request_id=6ef8e0d2-d814 -478a-bbe2-e624789aceee fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=304 bytes=237 protocol=https
- 2018-09-07T06:59:42.215849+00:00 heroku[路由器]: at=info method=GET path="/js/ForgeTree.js" host=forgebcsample.herokuapp.com request_id=6d58c9c0-afce-4c44-b1e0-f9d40326c607 fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=304 bytes=238 protocol=https
- 2018-09-07T06:59:42.214891+00:00 heroku[路由器]: at=info method=GET path="/css/main.css" host=forgebcsample.herokuapp.com request_id=66be297d-0707-4e5d-8c6a-c4fb269c11f0 fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=304 bytes=237 protocol=https
- 2018-09-07T06:59:42.453624+00:00 heroku[路由器]: at=info method=GET path="/js/ForgeViewer.js" host=forgebcsample.herokuapp.com request_id=bc8f0050-1ca2-46b9-84be-d1e36c8afcf4 fwd="202.148.226.254" dyno=web.1 connect=1ms service=4ms status=304 bytes=237 protocol=https
- 2018-09-07T06:59:43.486820+00:00 heroku[路由器]: at=info method=GET path="/api/forge/oauth/token" host=forgebcsample.herokuapp.com request_id =d6acdca3-1424-48b9-9480-d0497af58179 fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=401 bytes=127 protocol=https
- 2018-09-07T07:00:51.391643+00:00 heroku[路由器]: at=info method=GET path="/api/forge/oauth/url" host=forgebcsample.herokuapp.com request_id =ab185f67-7288-43ce-bdf7-9551b8771bba fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=200 bytes=382 protocol=https
- 2018-09-07T07:00:58.551942+00:00 heroku[路由器]: at=info method=GET path="/api/forge/callback/oauth?code=46TAvefGUSv_xZ6cTJKzyx-t-HT6Y2FzvDyzZQIS" host=forgebcsample.herokuapp.com request_id=b67abc9f-419e-47d3-892a-3fcc6fbf7f7d fwd="202.148.226.254" dyno=web.1 connect=1ms service=227ms status=302 bytes=234 protocol=https
- 2018-09-07T07:00:58.808686+00:00 heroku[路由器]: at=info method=GET path="/" host=forgebcsample.herokuapp.com request_id=1a2ff1de-513e -40e2-a73a-0b48781a06bc fwd="202.148.226.254" dyno=web.1 connect=1ms service=17ms status=304 bytes=237 protocol=https
- 2018-09-07T07:00:59.082869+00:00 heroku[路由器]: at=info method=GET path="/css/main.css" host=forgebcsample.herokuapp.com request_id=428a5759-895f-45e5-a9db-48d8721889c0 fwd="202.148.226.254" dyno=web.1 connect=1ms service=5ms status=304 bytes=237 protocol=https
- 2018-09-07T07:00:59.325093+00:00 heroku[路由器]: at=info method=GET path="/js/ForgeTree.js" host=forgebcsample.herokuapp.com request_id=04a300dc-8697-4097-8c06-1788e21db69d fwd="202.148.226.254" dyno=web.1 connect=1ms service=3ms status=304 bytes=238 protocol=https
- 2018-09-07T07:00:59.822084+00:00 heroku[路由器]: at=info method=GET path="/js/ForgeViewer.js" host=forgebcsample.herokuapp.com request_id=c601f61e-cfea-4738-8837-540941adaf96 fwd="202.148.226.254" dyno=web.1 connect=1ms service=11ms status=304 bytes=237 protocol=https
- 2018-09-07T07:01:00.157419+00:00 heroku[路由器]: at=info method=GET path="/api/forge/oauth/token" host=forgebcsample.herokuapp.com request_id =77b86dc0-50c7-429e-ade9-82e1b8fa56db fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=401 bytes=127 protocol=https
在您登录之前预计 401
,那么它应该 return 200
我尝试了 运行 您的 herokuapp,但由于 callback url
设置不正确而无法登录。请确保它使用与您的 Forge 应用程序完全相同的值。
编辑
可以尝试在 start.js
上评论以下行
secure: (process.env.NODE_ENV === 'production'),
我在 Heroku 上安装了 http://learnforge.autodesk.io tutorial and locally the apps work fine. But when I try to deploy the forge.tutorial.viewhubmodels.nodejs 应用程序,当我尝试登录时出现以下错误:
GET https://forgebcsample.herokuapp.com/api/forge/oauth/token 401 (Unauthorized)
Heroku 仪表板中的 Config Vars 是正确的,我更新了 Forge Developer Portal 上的值,如部署教程中所述。我什至尝试将 FORGE_CLIENT_ID、FORGE_CLIENT_SECRET 和 FORGE_CALLBACK_URL 硬编码到应用程序中,但错误仍然存在。
Heroku 日志:
- 2018-09-07T06:59:41.950470+00:00 heroku[路由器]: at=info method=GET path="/" host=forgebcsample.herokuapp.com request_id=6ef8e0d2-d814 -478a-bbe2-e624789aceee fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=304 bytes=237 protocol=https
- 2018-09-07T06:59:42.215849+00:00 heroku[路由器]: at=info method=GET path="/js/ForgeTree.js" host=forgebcsample.herokuapp.com request_id=6d58c9c0-afce-4c44-b1e0-f9d40326c607 fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=304 bytes=238 protocol=https
- 2018-09-07T06:59:42.214891+00:00 heroku[路由器]: at=info method=GET path="/css/main.css" host=forgebcsample.herokuapp.com request_id=66be297d-0707-4e5d-8c6a-c4fb269c11f0 fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=304 bytes=237 protocol=https
- 2018-09-07T06:59:42.453624+00:00 heroku[路由器]: at=info method=GET path="/js/ForgeViewer.js" host=forgebcsample.herokuapp.com request_id=bc8f0050-1ca2-46b9-84be-d1e36c8afcf4 fwd="202.148.226.254" dyno=web.1 connect=1ms service=4ms status=304 bytes=237 protocol=https
- 2018-09-07T06:59:43.486820+00:00 heroku[路由器]: at=info method=GET path="/api/forge/oauth/token" host=forgebcsample.herokuapp.com request_id =d6acdca3-1424-48b9-9480-d0497af58179 fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=401 bytes=127 protocol=https
- 2018-09-07T07:00:51.391643+00:00 heroku[路由器]: at=info method=GET path="/api/forge/oauth/url" host=forgebcsample.herokuapp.com request_id =ab185f67-7288-43ce-bdf7-9551b8771bba fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=200 bytes=382 protocol=https
- 2018-09-07T07:00:58.551942+00:00 heroku[路由器]: at=info method=GET path="/api/forge/callback/oauth?code=46TAvefGUSv_xZ6cTJKzyx-t-HT6Y2FzvDyzZQIS" host=forgebcsample.herokuapp.com request_id=b67abc9f-419e-47d3-892a-3fcc6fbf7f7d fwd="202.148.226.254" dyno=web.1 connect=1ms service=227ms status=302 bytes=234 protocol=https
- 2018-09-07T07:00:58.808686+00:00 heroku[路由器]: at=info method=GET path="/" host=forgebcsample.herokuapp.com request_id=1a2ff1de-513e -40e2-a73a-0b48781a06bc fwd="202.148.226.254" dyno=web.1 connect=1ms service=17ms status=304 bytes=237 protocol=https
- 2018-09-07T07:00:59.082869+00:00 heroku[路由器]: at=info method=GET path="/css/main.css" host=forgebcsample.herokuapp.com request_id=428a5759-895f-45e5-a9db-48d8721889c0 fwd="202.148.226.254" dyno=web.1 connect=1ms service=5ms status=304 bytes=237 protocol=https
- 2018-09-07T07:00:59.325093+00:00 heroku[路由器]: at=info method=GET path="/js/ForgeTree.js" host=forgebcsample.herokuapp.com request_id=04a300dc-8697-4097-8c06-1788e21db69d fwd="202.148.226.254" dyno=web.1 connect=1ms service=3ms status=304 bytes=238 protocol=https
- 2018-09-07T07:00:59.822084+00:00 heroku[路由器]: at=info method=GET path="/js/ForgeViewer.js" host=forgebcsample.herokuapp.com request_id=c601f61e-cfea-4738-8837-540941adaf96 fwd="202.148.226.254" dyno=web.1 connect=1ms service=11ms status=304 bytes=237 protocol=https
- 2018-09-07T07:01:00.157419+00:00 heroku[路由器]: at=info method=GET path="/api/forge/oauth/token" host=forgebcsample.herokuapp.com request_id =77b86dc0-50c7-429e-ade9-82e1b8fa56db fwd="202.148.226.254" dyno=web.1 connect=1ms service=2ms status=401 bytes=127 protocol=https
在您登录之前预计 401
,那么它应该 return 200
我尝试了 运行 您的 herokuapp,但由于 callback url
设置不正确而无法登录。请确保它使用与您的 Forge 应用程序完全相同的值。
编辑
可以尝试在 start.js
上评论以下行secure: (process.env.NODE_ENV === 'production'),