Logic Machine Forum
Remote service without basic auth - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: Remote service without basic auth (/showthread.php?tid=5532)



Remote service without basic auth - Andrea Becagli - 25.07.2024

I am trying to use Remote services with an LM with 20240426 firmware but since there is no more basic auth, it does not work and always asks to login (if I use get request through browser). Is there a solution? Do I need to add some body to the request maybe?


RE: Remote service without basic auth - admin - 25.07.2024

Working example using Fetch API:

Code:
async function send() {
  var url = 'http://192.168.0.9/scada-remote?m=json&r=grp&fn=write&alias=0/0/1&value=1'
  var user = 'remote'
  var pass = 'Remote123'
  var headers = new Headers()

  headers.append('Authorization', 'Basic ' + btoa(`${user}:${pass}`))

  var res = await fetch(url, { method: 'GET', headers: headers })

  console.log(res)
}



RE: Remote service without basic auth - Andrea Becagli - 27.07.2024

Ok, that could be a problem since I am trying to exchange info with Yealink phones, which can not make requests with headers. Is there a way I can make API calls without a header?


RE: Remote service without basic auth - admin - 29.07.2024

You can create a .lp script instead: https://kb.logicmachine.net/misc/apps/#lp-scripts
It does not require authentication if placed in the public directory.


RE: Remote service without basic auth - Andrea Becagli - 05.08.2024

(29.07.2024, 06:25)admin Wrote: You can create a .lp script instead: https://kb.logicmachine.net/misc/apps/#lp-scripts
It does not require authentication if placed in the public directory.

Interesting, could you give me an example of a script like this?


RE: Remote service without basic auth - admin - 06.08.2024

Check this: https://forum.logicmachine.net/showthread.php?tid=3141&pid=20407#pid20407
The example above can be placed in user directory so only authorized users can access it.


RE: Remote service without basic auth - Joep - 28.02.2025

I'm using the remote service from different devices and one stopped working. Is it possible that it's due to basic authentication that this one stopped working?

I'm using the same url for both systems: http://user:pass@192.168.0.10/scada-remote?m=json&r=grp&fn=write&alias=4/1/6&value=true


RE: Remote service without basic auth - Daniel - 28.02.2025

Which firmware do you use and what posting the command


RE: Remote service without basic auth - Joep - 28.02.2025

(28.02.2025, 09:52)Daniel Wrote: Which firmware do you use and what posting the command

Hi Daniel i'm using a Wiser for KNX with firmware 2.8.3
I use the remote service from a Yealink phone and that works. And i use it from Doorbird but that doesn't work anymore.
I just copy / paste the url so the url is 100% working.


RE: Remote service without basic auth - Daniel - 28.02.2025

If you use 2.8.3 then this is Doorbird issue, you should contact them for help. From 3.0.0 things might work differently due to session based authentication.


RE: Remote service without basic auth - Joep - 28.02.2025

(28.02.2025, 10:02)Daniel Wrote: If you use 2.8.3 then this is Doorbird issue, you should contact them for help.  From 3.0.0 things might work differently due to session based authentication.

Ok Daniel thanks a lot for your quick response and help. I will contact Doorbird.


RE: Remote service without basic auth - Joep - 05.03.2025

Doorbird is telling me that this should work fine so no problems from their side.

When i try to call the remote service url from script i got this info back. So it seems to be an authentication issue? Is basic authentication also no longer allowed by the Wiser and how can i solve this? In other words how can i use the Remote Service any longer or is their a better option?

Remote service test 05.03.2025 16:35:43
* arg: 1
  * string: statusText
* arg: 2
  * string: HTTP/1.1 401 Unauthorized


Remote service test 05.03.2025 16:35:43
* string: headers:


Remote service test 05.03.2025 16:35:43
* arg: 1
  * string:
* arg: 2
  * string: location
* arg: 3
  * string: https://192.168.0.10/scada-remote?m=json&r=grp&fn=write&alias=0/0/100&value=true


Remote service test 05.03.2025 16:35:43
* arg: 1
  * string:
* arg: 2
  * string: transfer-encoding
* arg: 3
  * string: chunked


Remote service test 05.03.2025 16:35:43
* arg: 1
  * string:
* arg: 2
  * string: connection
* arg: 3
  * string: close


Remote service test 05.03.2025 16:35:43
* arg: 1
  * string:
* arg: 2
  * string: date
* arg: 3
  * string: Wed, 05 Mar 2025 15:35:43 GMT


Remote service test 05.03.2025 16:35:43
* arg: 1
  * string:
* arg: 2
  * string: www-authenticate
* arg: 3
  * string: Basic realm="pand"


Remote service test 05.03.2025 16:35:43
* arg: 1
  * string:
* arg: 2
  * string: set-cookie
* arg: 3
  * string: x-login=0; Path=/; SameSite=Strict, x-auth=; Path=/; SameSite=Strict


Remote service test 05.03.2025 16:35:43
* arg: 1
  * string:
* arg: 2
  * string: content-type
* arg: 3
  * string: text/plain; charset=utf-8


Remote service test 05.03.2025 16:35:43
* arg: 1
  * string: data
* arg: 2
  * string: Invalid login and/or password. Your access will be blocked after 5 consecutive unsuccessful login attempts.


RE: Remote service without basic auth - Daniel - 05.03.2025

Again, we didn't change anything in 2.8.3. The thread is related to latest firmware with session based authentication. It seems that you are not using correct credentials. Your other device works correctly.
You can still use the solution admin proposed above.


RE: Remote service without basic auth - Joep - 19.03.2025

UPDATE: The issue was related to Doorbird. They now installed another firmware on my device and it is working again with basic authentication. So i hope this info can help others too.