Launch web page secured with HTTP authentication from a terminal kiosk

chromecurlterminalurl

I am trying to launch Chromium to open a specific webpage that requires username and password login details. I can open the webpage no problem from the terminal however I have been unable to so far pass the username and password to login.

Some more information, it appears as though I can login using Curl using the following command however as you'd expect this does not open chrome, it just gives me the output in the terminal

curl -u username:password "https://mywebpagelogin.html"

It seems as though I have most of the pieces required to get this working I just can't seem to tie it all together. This is not my website and I do not have access to the source code however the authentication window pops up as soon as the web page is accessed if that information is useful. I've include a screenshot below:

screenshot, user auth

Any help is much appreciated.

Best Answer

It looks like the website is using HTTP authentication. In that case you should be able to provide the authentication details as part of the URL similar to:

https://username:password@example.com/login.html

I last used this feature about 15 years ago. Back then, Netscape Navigator hid the password by displaying the URL for the rest of that authentication realm (website) as:

https://username@example.com/

Chromium also support(ed) usernames and passwords in URLs for HTTP authentication. If the displayed user name is not sensitive information, this solution could suit your purposes. However, support for passwords embedded in URLs was removed in version 19, reinstated in the following release and later removed again.

Note: Including passwords in the userinfo part of a URI was deprecated in RFC 3986, the official specification for the syntax of Uniform Resource Identifiers (URIs).

Related ServerFault question: Can you pass user/pass for HTTP Basic Authentication in URL parameters?

Related Question