2

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.

  • Would it be useful to save the password in the browser or does it timeout? Would a plug-in like last pass satisfy your needs? (This does not seem a question for the Linux group) – Rui F Ribeiro Nov 19 '15 at 10:02
  • plugins like last pass are not an option, I need to launch the browser from terminal passing username and password. The webpage will be displayed on a kiosk without input this all needs to be done from the terminal if possible, without any user input. Thanks for the help – tuxedozombie Nov 19 '15 at 10:19
  • Leaving it on a kiosk open wont timeout by default? The best option would be to configure on the webserver an exception not to ask for authentication (yes, I have read you do not control it) – Rui F Ribeiro Nov 19 '15 at 10:21
  • It seems a job for some sort of a local proxy doing the authentication and you point your browser to it. – Rui F Ribeiro Nov 19 '15 at 10:22
4

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?

  • 2
    This is working. Nice work, thanks for the help. I'd upvote but don't have enough rep :( – tuxedozombie Nov 19 '15 at 10:57
  • 1
    @tuxedozombie Happy to help. I didn't realise that new users don't have enough rep to upvote answers (even to their own questions). I've previously wondered why they wouldn't upvote useful answers so thanks for explaining that. Welcome to Stack Exchange! – Anthony Geoghegan Nov 19 '15 at 11:04
  • 1
    It's very strange I agree, I'm a member of StackOverflow and have 24 rep, you'd have thought the rep carries between Stack sites. Thanks again though – tuxedozombie Nov 19 '15 at 11:09
  • Not working anymore, it has been blocked by chrome for security reasons – maxime Jun 13 '18 at 17:51
  • 1
    @maxime Thanks for the update. I've edite my answer to include this information. – Anthony Geoghegan Jun 13 '18 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.