der_micha
(Michael)
February 11, 2021, 9:22am
1
Hi,
in OH 2.5x i have a rule to check if bindings are online or offline, for example:
when
Thing "innogysmarthome:bridge:SMARTHOME09" received update or
System started
then
var response = sendHttpGetRequest("http://xxx.xxx.xxxx.x:8080/rest/things/innogysmarthome:bridge:SMARTHOME09")
var String status= transform("JSONPATH", "statusInfo.status", response)
Innogy_Status.postUpdate(status)
When i try this in OH3, i get the following error:
{“error”:{“message”:“Authentication required”,“http-code”:401}}
How can i submit my user credentials in a rule in OH3?
I tried http://user:password@xxx.xxx.xxx.x but this didn’t work.
Thanks in advance for any help.
This might solve your issues
If you want to use Basic auth you have to enable it in the settings.
der_micha
(Michael)
February 11, 2021, 11:01am
4
Thanks, but Basic Authentication is already enabled:
I wrote nonsense. Ignore this post.
icompas
(Immo)
February 11, 2021, 12:16pm
6
Struggling with the same issue.
checked basic authentication
unchecked ‘implicite user role’
FF is now concerned that I send a user:password, and even though confirming that this is ok,
I receive also,
{"error":{"message":"Authentication required","http-code":401}}
Can you show the request you are making (with dummy pw/user)?
If it is in the form http://user:pw@oh_host:oh_port/rest..
it should definitely work
opus
(Jürgen Baginski)
February 11, 2021, 3:10pm
8
I’m using Basic Authentication and have the “Impicit user role…” checked to ON. With those settings my REST calls via a rule are working!
Yes - it works and correct setting is implicit user role
to on.
Sorry - I was confused.
The problem is probably a typo in the url
der_micha
(Michael)
February 11, 2021, 8:10pm
10
I still get the error:
{“error”:{“message”:“Authentication required”,“http-code”:401}}
My request:
sendHttpGetRequest(“http://user:password@192.168.0.48:8080/rest/things/innogysmarthome:bridge:xxx ”)
What could be wrong with this url? In OH 2.5 this is working fine (without user credentials).
halloween
(Hallo Ween)
December 20, 2022, 8:56am
11
Hi, i changed to oh3 and now my rest api ist not working anymore.
My doorphone is sending a command to oh and then oh opens the door:
Action URL inside my doorphone:
http://192.168.1.99:8080/classicui/CMD?RFID_uid_haustuer=$card_sn
I also added user and password like this, but no success. I get no error messages inside my log. Simply not working…
http://192.168.1.99:8080/classicui/CMD?RFID_uid_haustuer=$card_sn -u {oh3_adminuser}:{oh3password}
I activated basic authentication in “API-Sicherheit” inside OH3 Settings.
oh3_adminuser is the user/pass of the new admin user i made while upgrading to oh3 on first run.
rossko57
(Rossko57)
December 20, 2022, 10:11am
12
halloween:
/classicui/CMD?
This is an undocumented usage. Or rather, was an undocumented usage in OH2, doesn’t exist in OH3
See
Hello there,
in OH2 I´ve used to use classicui/CMD pass an String-Value to an Item via HTTP GET Request like
http://192.168.X.X:8080/classicui/CMD?String=VAR
How can this be done in OH3?
I have already made several attempts with the HTTP binding, unfortunately unsuccessful. Manipulating the Var with curl works but I need to to this by user clicking on a URL.
Thank you very much!
halloween
(Hallo Ween)
December 20, 2022, 10:17am
13
I made some tests: When i change classicui to basicui it is still working.
1 Like
somy
(mai)
March 28, 2023, 12:13pm
14
I managed to make this to work in rules, however I’m not happy with hard coded username/password in rules file. Is there a better solution?