-
I'm trying to use this plugin using the REST API that you show on the readme, but everything I'm trying ends up with a message "You do not have permission to view this resource, Please Login". I am logged in as far as anything I can see, but clearly I'm missing something. I've looked around for information or examples of how to do this and am finding nothing. My goal is to use NodeRed to send these messages to the plugin. Appreciate the help and the work you're doing! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you're just using the Same is true if you're using node-red to make POST requests. You need to pass a token along with the http POST request. You can create a token for this by running this command on the sk server:
(Note that this creates a token that will work for one year, you could use 100y or 30d depending on your preference) Now that you have a token, you can pass that on wth a http header via curl or a node-red node.
|
Beta Was this translation helpful? Give feedback.
If you're just using the
curl
commands from the README, then they will fail when security is turned on.Same is true if you're using node-red to make POST requests.
You need to pass a token along with the http POST request.
You can create a token for this by running this command on the sk server:
signalk-generate-token -u YourUserName -e 1y -s ~/.signalk/security.json
(Note that this creates a token that will work for one year, you could use 100y or 30d depending on your preference)
Now that you have a token, you can pass that on wth a http header via curl or a node-red node.