I currently use Cumolocity IoT (Free Trial) and Node-Red v3.1.0 and I need to communicate my field equipment through node-red and send the information to Cumolocity IoT.
Reviewing information from the documentation I found the following: “Device Integration using REST”
However, when I use my nodes in node red I get an invalid credentials error when trying to send data via REST (HTTP Request node):
Error Message:
msg.payload : string[200]
“{“error”:“security/Unauthorized”,“message”:“Invalid credentials! : Bad credentials”,“info”:“htp/www.cumulocity.com/guides/reference/rest-implementation//#a-name-error-reporting-a-error-reporting”}”
I share some screenshots of my node flow and configuration:
Node-Red Flow: It consists of an inject node, connected to a function node and finally sent through an “HTTP Request” node
Credentials of User The user “AFlores” has all the roles and privileges of Cumolocity IOT
Finally comment on my tenant information:
TenantId: env770035 User: AFlores
PS1: The interesting thing is that with this account env770035/AFlores I have been able to communicate via MQTT to Cumolocity IoT (Free Trial)
PS2: For the username and password in RES, I understand that it must be encoded in Base 64 under the following nomenclature “Basic TenantID/User:Password”, and that is how it is configured in the red node (HTTP REQUEST NODE), however the error does not disappear.
I thank everyone for their support and I hope you can give me some idea of what is happening.
When you go in your Tenant UI to Administration > Accounts > Users and click on this user, does it say You cannot edit the user since it is managed via your authorization server?
Can you open a terminal and send this curl (fill in your password first):
Just a guess, but I suspect there are some invalid characters (e.g. a ‘ instead of '), but I’m not sure if it is just a problem with the rendering on the website after you’ve pasted it.