WebThingsIO / gateway

WebThings Gateway - a self-hosted web application for monitoring and controlling a building over the web
http://webthings.io/gateway
Mozilla Public License 2.0
2.62k stars 339 forks source link

Add `BearerSecurityScheme` to Thing Descriptions for Server-Sent Events #3078

Open benfrancis opened 1 year ago

benfrancis commented 1 year ago

The only security scheme currently mentioned in Thing Descriptions is the OAuth2SecurityScheme, which assumes that tokens will be provided in an Authorization header.

Because the EventSource and WebSocket browser APIs to do not allow explicitly setting an Authorization header, the the gateway also supports providing a JWT in a query string.

This could be communicated to WoT Consumers by including the BearerSecurityScheme in the security metadata of Thing Descriptions, with in set to query and name set to jwt.