Error running Vorto Dashboard for Bosch iot suite

◇◆丶佛笑我妖孽 提交于 2021-01-28 10:11:01

问题


I am trying to run Vorto dashboard on Raspberry Pi to visualize my Bosch IoT "things" data.

In order to run the Vorto Dashboard, I installed npm and nodejs and created the config.json file.

I am getting the below error whenever I try to run the dashboard using the command: sudo vorto-dashboard config.json, knowing that I already added the OAuth2 Client credentials.

No credentials given, can not get things

Could not get the token with given credentials. - StatusCodeError: 400 - {"error":"unauthorized_client","error_description":"INVALID_CREDENTIALS: Invalid client credentials"}


回答1:


TL;DR

To resolve your issue, store your OAUth credentials as environmental variables.

E.g. in debian et al., export BOSCH_CLIENT_ID=... etc., then start the dashboard in the same terminal.


Context

I was about to ask the same question, as I got the same error message no matter how I referenced the config.json file (relative path, absolute path, no reference, etc.).

For clarification, the tutorial pointing to a config.json resource for storing OAuth credentials is here.

Quoting:

While the dependencies are being installed, create the config.json file and insert client_id, secret and scope from your Already created OAuth2 Client. The content of the file has to look like this:

{ "client_id": "<YOUR_CLIENT_ID>", "client_secret": "<YOUR_CLIENT_SECRET", "scope": "<YOUR_SCOPE>", "intervalMS": 10000 }

The reference to the config.json file has been removed from the README.md resource in the vorto-dashboard module of vorto-examples.

The latest README.md suggests providing the OAuth credentials through environmental variables:

You can provide your OAuth2 credentials through environment variables. The three environment variables you have to provide are:

BOSCH_CLIENT_ID

BOSCH_CLIENT_SECRET

BOSCH_SCOPE

[...]

Looking at the source, I can only find an explicit reference to a config.json in the start script entry for package_for_deployment.json (nor anything around the source seems to be consuming, say, argv[2] for that matter).

The AuthToken.js resource in charge of handling OAuth credentials only seems to reference environmental variables through the process.env.[...] references.

Elaboration

This is only speculation at the time of writing, but I suspect the reason why the config.json methodology has been abandoned might have something to do with strengthening security, i.e. not storing OAuth credentials permanently in a file.

If that much is true, then the tutorial page should probably be amended with the latest instructions from the README.md.




回答2:


I am currently contributing the Vorto Project as an Intern at Bosch. Due to changes in the Vorto-Dashboard we combined and merged the functionality of a previous dashboard with another coexisting updated UI, providing advanced ways to visualize the existing devices.

As the uploaded state was work in progress, we temporarily disabled the config.json methodology and removed existing references from the documentation. Apparently, the reference in the tutorial you found was omitted, sorry for that!

Today, I deployed a new version 0.5.0 of the vorto-dashboard which should work as usual. You are now able to work with either process.env.[...] varibales or a config.json file. Thank you Mena for the quick response!

Feel free to let me know if you need any further help or have additional feedback.



来源:https://stackoverflow.com/questions/58487307/error-running-vorto-dashboard-for-bosch-iot-suite

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