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

API - HTTP Get Request No Password possible #1129

Open
Spy-1 opened this issue Nov 17, 2022 · 16 comments
Open

API - HTTP Get Request No Password possible #1129

Spy-1 opened this issue Nov 17, 2022 · 16 comments
Labels
confirmed-bug confirmed bug

Comments

@Spy-1
Copy link

Spy-1 commented Nov 17, 2022

Can someone please give me assistance with an http request?
The following request works:
192.132.198.112/rpc/Shelly.SetState?id=1&type=0&state={%22state%22%3atrue}

However, if a password is set in the interface of the device, I can't get the request to work.

How and where do I set the password?

@Spy-1 Spy-1 changed the title API - HTTP Get Request API - HTTP Get Request No Password possible Nov 18, 2022
@Spy-1
Copy link
Author

Spy-1 commented Nov 18, 2022

Does no one have any help for me ???

According to the description you should put a -user "admin:" -digest
in front.
Unfortunately this does not work!

An example request, also in the wiki, would be extremely helpful!

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale OP has not replied, gone stale, ready to close. label Dec 19, 2022
@Spy-1
Copy link
Author

Spy-1 commented Dec 19, 2022

Is there a chance for fixing this?1

@timoschilling timoschilling added waiting-for-rojer waiting for rojer assistance. and removed stale OP has not replied, gone stale, ready to close. labels Dec 19, 2022
@markirb
Copy link
Collaborator

markirb commented Dec 22, 2022

Can you provide an error message? Are you using curl?

@Spy-1
Copy link
Author

Spy-1 commented Dec 22, 2022

Sorry, no error Message!
Pure HTTP request via Browser works without password

@markirb
Copy link
Collaborator

markirb commented Dec 22, 2022

Again: are you using curl?

@markirb
Copy link
Collaborator

markirb commented Dec 22, 2022

The command is only valid for curl.

I do have the impression you're trying this via browser. The escaped url speeks that.

There's nothing to fix here....

https://en.wikipedia.org/wiki/CURL

@Spy-1
Copy link
Author

Spy-1 commented Dec 23, 2022

No, i don´t use curl.
I am trying to control a shelly via an http-request.
This works fine without a password and user set in the interface
Once a user and password is entered in the interface this does not work anymore.
192.168.178.120/rpc/Shelly.SetState?id=1&type=0&state={"state":false} ist working well.

What ist the right request with setting a user and Password in shellys Userinterface?

@markirb
Copy link
Collaborator

markirb commented Dec 23, 2022

Your request url is correct. You have to get the authentication right, therefore you have to send the right http headers as defined in
https://en.wikipedia.org/wiki/Basic_access_authentication

How to do this is dependant on you browser, i saw there might be some plugins.
The example you mentioned is for curl.
I have not done this but should be doable.

Again, there is nothing to fix here...

@Spy-1
Copy link
Author

Spy-1 commented Dec 24, 2022

Again, this works in every browser! How to set this string witht admin and password to get him work!
Where do i have to place this : --digest -u admin:1234

http://192.168.178.120/rpc/Shelly.SetState?id=1&type=0&state={"state":false} ist working well.
--digest -u admin:1234 http://... does not if password is set in user interface

@markirb
Copy link
Collaborator

markirb commented Dec 28, 2022

This works in every browser yes, the browser internally does https://en.wikipedia.org/wiki/Digest_access_authentication when calling the RPC backend via Javascript.
It works that way, because for security reasons you do not send passwords via cleartext over a get request as that defeats most of the purpose of having a password in the first case (that's what you're basically asking).

What is your end use case of this? Maybe you can find a solution via cURL. You could also run reuse some of the Webpages Javascript and run that on your browser...

@Spy-1
Copy link
Author

Spy-1 commented Dec 28, 2022

I use a Lightmanager from jbMedia with which I can control different devices via radio, LAN or also e.g. Hue lights and other.
The input mask for LAN controls looks like on the screenshot.
Since I would like to secure my Shelly with a password, I can not use it in the configuration.
Zwischenablagebild

@timoschilling
Copy link
Collaborator

timoschilling commented Dec 28, 2022

@Spy-1 You can try http://admin:<your password>@<ip>/…

@Spy-1
Copy link
Author

Spy-1 commented Dec 28, 2022

and this is exactly this what doesn´t work!

@timoschilling timoschilling added the confirmed-bug confirmed bug label Feb 2, 2023
@albundy0815
Copy link

and this is exactly this what doesn´t work!

I can agree. It also doesn't work on my side

@timoschilling timoschilling removed the waiting-for-rojer waiting for rojer assistance. label Feb 8, 2023
@markirb
Copy link
Collaborator

markirb commented Feb 9, 2023

This is not a bug. It is not supported currently and thus a feature request

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

No branches or pull requests

4 participants