Error Running Vorto Dashboard For Bosch Iot Suite
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"}
Answer
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 insertclient_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.
Related Questions
- → Maximum call stack exceeded when instantiating class inside of a module
- → Browserify api: how to pass advanced option to script
- → Node.js Passing object from server.js to external modules?
- → gulp-rename makes copies, but does not replace
- → requiring RX.js in node.js
- → Remove an ObjectId from an array of objectId
- → Can not connect to Redis
- → React: How to publish page on server using React-starter-kit
- → Express - better pattern for passing data between middleware functions
- → Can't get plotly + node.js to stream data coming through POST requests
- → IsGenerator implementation
- → Async/Await not waiting
- → (Socket.io on nodejs) Updating div with mysql data stops without showing error