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

Remote browser login #32

Open
su-sd opened this issue Nov 13, 2024 · 3 comments
Open

Remote browser login #32

su-sd opened this issue Nov 13, 2024 · 3 comments

Comments

@su-sd
Copy link

su-sd commented Nov 13, 2024

If somebody needs to connect without access to the "login-wifi", you can use the following script in the browser console:

let password =  "PASSWORD";
let result = await (await fetch(
	"https://IP/v1/user/setting/login",
	{
		method: "PUT",
		body: JSON.stringify({"password": password}),
		headers: {
			"Charset": "UTF-8",
			"Content-Type": "application/json",
		},
	})).json();
sessionStorage.setItem('auth_key', result.auth_key)
sessionStorage.setItem("role", "user")

Not sure where to document.

@gluap
Copy link
Owner

gluap commented Nov 14, 2024

@su-sd did you try that shortly after having authenticated on the login wifi? I had observed getting the token was possible via external network once but later it turned out that was only reproducible within a few minutes after login on wifi.

@su-sd
Copy link
Author

su-sd commented Nov 24, 2024

@gluap
Interesting. Last time I was in the ess wifi was over half a year ago. I logged in since that a few times.
I use the following page https://192.168.[ESS.IP]/system/index.html, the root-directory always returns an error.
What is the result of the request above when it fails?

@gluap
Copy link
Owner

gluap commented Nov 24, 2024

Back in the day the response was something with {"success": "false"} . But it seems nowadays you're right: My ess also allows me to log in from the regular network.

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