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
Scott Bender
Scott Bender4w ago
That should work fine, so not doing something right.. I do that a lot to test using curl
Lille Ø
Lille Ø4w ago
If I remember correctly, tokens need admin privileges to work with plugin supplied endpoints
Scott Bender
Scott Bender4w ago
Not for PUT requests. Write permission is fine
Aswin
AswinOP4w ago
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?
Scott Bender
Scott Bender4w ago
So I guess these are not actual Signal K PUT requests? Just normal HTTP PUT requests?
Aswin
AswinOP4w ago
What is the difference?
Scott Bender
Scott Bender4w ago
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
Aswin
AswinOP4w ago
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

Did you find this page helpful?