Aswin - A authorisation related question. I hav...
A authorisation related question. I have a plugin that exposes some PUT endpoints. From the accompanying webapp I can successfully use these endpoints. But I also have another program (no browser) that cannot use these endpoints. It gets a 401 error. So I generated a token for this program to use, but still the 401. I successfully tested the token on SignalK endpoints, so I know the token is right.
Any ideas why the token won't work on plugin endpoints? Is there a better way to get commands/info to a plugin from a non browser source?
9 Replies
That should work fine, so not doing something right..
I do that a lot to test using curl
If I remember correctly, tokens need admin privileges to work with plugin supplied endpoints
Not for PUT requests. Write permission is fine
Thanks. I can confirm the token needs admin privileges to work with plugin supplied endpoints. This solved my problem.
Some related questions:
Websockets do not seem to need tokens (for subscriptions at least) or any form of authorisation. Is that right?
Can i create a websocket endpoint in a plugin?
So I guess these are not actual Signal K PUT requests? Just normal HTTP PUT requests?
What is the difference?
If you have “allow read only” on the security settings enabled. Then no token needed for subscriptions.
Sending deltas, PUT requests, etc. Require write permission
Yes, just normal HTTP PUT requests. I do not modify delta's in this case. FYI, the plugin is a boat simulator, via HTTP PUT request I hoist the sail, move the rudder of the simulator. The simulator itself generates deltas