WebThingsIO / thing-url-adapter

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

Authentication for url things #91

Open evert opened 4 years ago

evert commented 4 years ago

hi there!

I'm working on a garden-related system, and I thought it would be nice to eventually add Web Thing support.

I think adding things by url is really where the power of webthings is, as it removes the '1 adapter per device' issue. However, I don't see a facility to allow users to authenticate with anything.

Do you have any thoughts or plans on supporting this? The idea of using unauthenticated systems is not great and I would like to avoid adding secrets in urls.

mrstegeman commented 4 years ago

Right now, none of our webthing libraries support authentication. If you have a custom webthing that does, I’d be happy to take a look and see how we can support it.

evert commented 4 years ago

I don't have anything public yet. I was probably going to let webthings consumers decide what auth scheme to use, but if this doesn't really exists it presents a bit of a chicken and egg situation. Note that this is a toy project, but authentication seems prudent all the same.

If I added support for, say, Bearer authentication, do you see a possibility that this might be added to thing-url-adapter? A single bearer token goes a long way, and is much less a can of worms than say, full oauth2 + a discovery mechanism.

mrstegeman commented 4 years ago

We can definitely find a way to support it. If/when you have support for something, let me know and I can take a look!

evert commented 4 years ago

Ok, will report back once I have something public =)

MarcGraham commented 4 years ago

Hi,

Wanted to jump into this thread. I also need webthings to support some sort of authentication. I chose jwt. Maintaining compatibility with the gateway is very important to me as well.

I have working implementations of both the webthing-python and thing-url-adapter in these forks:

https://github.com/m2ag-labs/webthing-python https://github.com/m2ag-labs/thing-url-adapter

I have both projects setup so they can be installed with no config and work the way things currently work