Add user authentication to the Update Tool

The hub uses a token based authentication. You will need to hit the login endpoint first with a user and password and then get the resulting token from the session for other sessions.

Weird, I may not be doing things right but I'm using the same mechanism I use to get the backups which gets the session from the login page and then hits the download URL and works fine, in this case i'm hitting the http://ipaddress:8080/hub/restart instead and get the hubitat 404 page...

It should be /hub/reboot not restart

Darn...beyond my skillset. Hopefully @gparra can figure this out.

1 Like

I haven't set up any users, will there still be authentication required for the pages?

@vjv @mike I can confirm that the tasker method I shared no longer works with the latest hot fix and User Admin turned on.

The bad news - I did quite a bit of googling and testing but was unable to figure out how authenticate with a token. It's simply beyond my abilities.

The kinda good news - if you dont NEED user admin, you can disable it and the tasker method will work again. Remote reboot is more important for me at this point so that's what I did.

1 Like

What was the hate clan name again?

I will not disable user login

I tried /hub/reboot and same thing I get a 404, if I can figure out how to do this authenticated I'll find a way for you guys to do it with Tasker but everything I do even after authenticating and passing the session is giving me a 404...

Don't Hate....FLAG!! :fist:

Seriously though...this was an oversight by the HE team that would have been closed at some point anyway. While I'm not as security conscious as others, I definitely understand the concerns.

And @gparra's got 24 hours before the Curse of Skade becomes permanent. Hopefully he finds a solution....either way justice will be served.

1 Like

Lol, FLAG!!!

Ok Guys!

This wasn't easy, its just a couple of lines of code but I had never used Tasker before and getting that @#$%@ cookie was quite tricky!

Just import this task (instructions in the description): link

Now, @stephack, @vjv, @SmartHomePrimer, please lift that curse!!! :rofl:

2 Likes

Uhtred, son of Uhtred, you may now resume your path. Destiny Is All...

1 Like

@gparra thank you for taking the time to figure this out. You didn't have to and it's appreciated. Worked like a charm.

Disclaimer: We still reserve the right to assemble team FLAG for any future transgressions.

2 Likes

@mike @SmartHomePrimer @vjv
The task @gparra posted worked perfectly. In case you dont want your password saved in a variable you can have the task ask for the Password every time and clear it at the end. Not perfect and requires interaction, but a decent option if you dont want your Password stored in clear text.

1 Like

:relieved: I can now sleep in peace...

Great solution! I changed my shared task with this!!

1 Like

Not yet, the course still in effect!

Uhtred of Bebbanburg, I lift the curse against gparra, now he can sleep in peace!

It worked perfectly, thanks!

2 Likes

Added one last check at the end to confirm the reboot happened, in case you don't enter the right password...

I got a licence of Tasker years ago and never used it but always wanted to, learned a lot with this, very useful tool!

1 Like

I have used it in so many ways over the years. Many times it has gone to the back burner, but there is always a hole it can fill.

Nice...saves me from having to load the web interface and keep hitting refresh over and over till I see the loading screen.