Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WWW-authentication issue #118

Open
frizby66 opened this issue Mar 29, 2023 · 6 comments
Open

WWW-authentication issue #118

frizby66 opened this issue Mar 29, 2023 · 6 comments

Comments

@frizby66
Copy link

frizby66 commented Mar 29, 2023

Describe the bug
Unable to trigger lock on Dahua Door Panel. Homebridge log returns 401 error

Expected behavior
Trigger door lock

To Reproduce
Steps to reproduce the behavior:
See config.

Version (output of npm list -g homebridge homebridge-http-switch)

  • homebridge: Homebridge v1.6.0
  • homebridge-http-switch: 0.5.36

Configuration

"accessory": "HTTP-SWITCH",
    "name": "panelrest",
    "method": "GET",
    "switchType": "stateless",
    "timeout": 1000,
    "debug": "true",
    "auth": {
        "username": "xxxxx",
        "password": "xxxxxxxx",
        "sendImmediately": "false"
    },
    "onUrl": "http://xxx.xx.x.xx/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=101&Type=Remote"

Additional context
See attached showing what Dahua API says about 401 authentication errors:-

"Video products support digest authentication, see RFC 2617 for detail. If the http request sent by client does not provide valid "Authorization" header information, video products would return HTTP status code 401 and some information for authentication, then client should calculate authentication information according RFC 2617, and sent request again with authentication information using “Authorization” header. Video products return the required resource only if authorization information correct.
For example:

  1. When digest authentication fails, video products’s response is :
  2. Then the client calculates the digest authorization using information like username, password, nonce, HTTP method and URI with MD5, and then sends it to server.When digest authentication fails, video products’s response is “401 Unauthorized” :"

Screenshot 2023-03-29 at 14 55 35

@feedericob
Copy link

hi,
i have the same problem, you find a solution?

Thanks

@frizby66
Copy link
Author

frizby66 commented Sep 29, 2023 via email

@feedericob
Copy link

@Supereg may you help us?

@feedericob
Copy link

feedericob commented Oct 1, 2023

sendImmediately is BOOLEAN and so the value is without "

{
"accessory": "HTTP-SWITCH",
"name": "Gate",
"switchType": "stateless",
"onUrl": {
"url": " http://192.168.1.250/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=101&Type=Remote",
"method": "GET",
"strictSSL": false,
"auth": {
"username": "xxx",
"password": "xxx",
"sendImmediately": false
}
}
}

@frizby66
Copy link
Author

frizby66 commented Oct 9, 2023 via email

@feedericob
Copy link

I can't help you on this, the plugin programmer should decide.

However, perhaps the lock button also identifies the opening and closing and if it is a simple gate without a sensor there is no possibility of identifying whether the gate is really open or closed.

you could display it as a push button, but I don't know how to do it.

@Supereg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants