asterics / AsTeRICS

The Assistive Technology Rapid Integration & Construction Set
http://www.asterics.eu
Other
54 stars 27 forks source link

Bug fix openhab3 REST API #358

Closed deinhofer closed 1 year ago

deinhofer commented 1 year ago

Bug fix openhab3 REST API: If the Accept types are not explicitly specified, the request fails with error code 400 or 401.

In OpenHab3 http basic auth authentication is disabled by default.

The basic auth authentication can be forced with Settings/API Security: grafik

This also enables API token authentication in case a token was created.

Unfortunately, the REST API in openhab 3 returns an error code 400 or 401 if the HTTP-header field Accept is not set correctly for the supported return types, which are text/plain and application/json.

So the fix simply sets the header fields. This also enables API token authentication from within asterics.

klues commented 1 year ago

👍