Getting Forge 2-legged authentication using Cross request

让人想犯罪 __ 提交于 2021-02-10 06:42:13

问题


I'm trying to create a simple html page to display a uploaded model to forge. For initialize the forge viewer it required the access-token. For request the access token I'm using the 2-legged oAuth on a Cross request(because I'm making the POST on different domain).But it keep getting error "No 'Access-Control-Allow-Origin' header is present on the requested resource". Please some one can tell me what should I do to get the acces-token successfully.


回答1:


As you noticed, you cannot obtain a Forge Token via client-side scripting, it will throw this CORS error. This is by design.

I would recommend a simple server-side authentication, it's quite direct to deploy this sample locally:

  1. Install NodeJS
  2. Download the project
  3. Set the variables with your ID & Secret
  4. Run the project


来源:https://stackoverflow.com/questions/39911487/getting-forge-2-legged-authentication-using-cross-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!