bp2008 / ui3

A powerful, modern HTML5 web interface for Blue Iris.
GNU Lesser General Public License v3.0
120 stars 18 forks source link

Add ui3.htm resources to login.htm #46

Closed editter closed 3 years ago

editter commented 3 years ago

Can you add the icons and manifest to the login.htm page so when it's added to the home screen it pulls in the correct icon and runs as "standalone" instead of as a shortcut?

bp2008 commented 3 years ago

Hmm. Yes, the next UI3 release will include this.

I slightly modified the manifest file for login.htm such that it declares the entrypoint to be ui3.htm. The effect of this is that the homescreen shortcut will bypass the login page if you happen to already have a session (e.g. having anonymous authentication enabled for LAN). Basically, the homescreen shortcut will work exactly as if you had created it while on ui3.htm.

Unfortunately the login page can only load supporting resources from the applet subdirectory, as that directory does not require an authenticated session. So I had to make a second copy of all the logo icons in there.

editter commented 3 years ago

I see the changes you added so thank you. I was initially thinking the start_url would be the login.htm but that might not make sense for people who don't require authentication.

The scenario I am trying to get around is that I have the images being fed into Home Assistant using basic auth but I also want to be able to login to UI3 using the login page. If I check the "Use secure session keys and login page" in BI then it doesn't allow me to use basic auth because it doesn't return a 401 response. Maybe this isn't related to the UI3 stuff at all and should be handled differently in the BI software itself because I assume you only control the client stuff.

bp2008 commented 3 years ago

Yeah. I can't change Blue Iris web server behavior at all.

I understand the problem you are having now. Last I checked, enabling "Use secure session keys and login page" does basically two things:

1) Enables less secure auth methods such as HTTP basic and allowing you to embed credentials in URL parameters. 2) In situations where the web server would have redirected to login.htm, it instead sends HTTP 401 to prompt for basic authentication.

You may be able to work around this much more cleanly by whitelisting your Home Assistant server's IP address so that Blue Iris won't require it to authenticate at all. This is done in Web server - Advanced by putting a ^ before the IP address you want to whitelist. e.g. in this example, connections from 127.0.0.1 are automatically given an admin session.

image

editter commented 3 years ago

Thank you so much for the help and thanks for the great work on this project! 🥇 I don't miss the days of having to remote into a computer on my phone just to view alerts