Search code examples
autodesk-forgeautodesk-viewerautodesk

400-unknown or invalid client_id for forge-bim360-data.connector.dashboard


I have tried to implement - https://github.com/Autodesk-Forge/forge-bim360-data.connector.dashboard
I have updated this part - npm install set FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>> set FORGE_CLIENT_SECRET=<<YOUR CLIENT SECRET>> set FORGE_CALLBACK_URL=<<your callback url of Forge e.g. http://localhost:3000/oauth/callback>> set DC_CALLBACK_URL=<<"your ngrok address here: e.g. http://abcd1234.ngrok.io/job/callback">>

I am getting the error that 400-Unknown or invalid client_id


Solution

  • Firstly, I rarely used Windows OS now. I simply copied the guideline of setting environment variables from other samples, while most time, I tried with debug mode (setting environment variables in launch.json) .

    checking the Readme again, I found the wording is:

       Windows (use Node.js command line from Start menu)
    

    i.e. it asks to input those commands to command line of Node.js, instead of terminal of VSCode! That is why it always reports the error of client id is not defined because the variables are not set to environment at all.

    The correct way is to open the command line of Node.js, and run the commands. This is a screenshot. enter image description here