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"}
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:
The reference to the
config.json
file has been removed from theREADME.md
resource in thevorto-dashboard
module ofvorto-examples
.The latest README.md suggests providing the OAuth credentials through environmental variables:
Looking at the source, I can only find an explicit reference to a
config.json
in thestart
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.