WebThingsIO / thing-url-adapter

Proxy adapter for Web Thing API endpoints
Mozilla Public License 2.0
21 stars 18 forks source link

Add jwt support for thing-url-adapter #96

Closed MarcGraham closed 3 years ago

MarcGraham commented 3 years ago

Will use token if one available. Add Authorization header to requests, adds same header to query string -- ?Authorization=Bearer jwt -- for web socket connections. Tokens can be entered in the thing-url-adapter config page. Use format hostname:port jwt with a space between I was able to test everything except the performAction and cancelAction functions.

MarcGraham commented 3 years ago

Sweet -- nice to see it in.

I noticed something that could be simplified at line 858

Screen Shot 2020-10-02 at 9 38 20 AM

Can probably just be

adapter.authData[urlStub] = url.authentication;

mrstegeman commented 3 years ago

Good call. Done.