ioBroker/ioBroker.web

Included SimpleAPI - Can not authenticate directly in URL

Opened this issue · 0 comments

Describe the bug
When authentication and (included) Simple-API is enabled one can not authenticate with URL parameters.
It brings you to /login/index.html instead.

To Reproduce
Steps to reproduce the behavior:

  1. Enable Authentication
  2. Enable Simple-API
  3. call URL https://iobrokerIP:8082/getPlainValue/0_userdata.0.my.Data?user=username&pass=Password123
  4. Instead of returning value it redirects to /login/index.html
  5. After manual authentication one call call https://iobrokerIP:8082/getPlainValue/0_userdata.0.my.Data and it returns the value (so API itself is working).

Expected behavior
Authentication via URL parameters and returning value.

Screenshots & Logfiles
If applicable, add screenshots and logfiles to help explain your problem.

Versions:

  • Adapter version: 4.3.0
  • JS-Controller version: 4.0.24
  • Node version: 16.19.0
  • Operating system: Ubuntu 22.04

Additional context
If this is expected behavior it pretty much renders authenticated api calls useless, as it always requires user input.
BASIC authentication (with sending headers) is not an option as this would be a global setting for other uses of the adapter as well.

Is there any other way to authenticate when using the included Simple-API? Couldn't find that anywhere.

Using the standalono Simple-API adapter is a workaround which works fine.
But since I read (on this repository somewhere) that the code for the standalone API adapter and the API included in the WEB-adapter is the same, I was surprised to find authentication not working.