4

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.

4
  • 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) Commented Nov 19, 2015 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 Commented Nov 19, 2015 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) Commented Nov 19, 2015 at 10:21
  • It seems a job for some sort of a local proxy doing the authentication and you point your browser to it. Commented Nov 19, 2015 at 10:22

1 Answer 1

7

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:[email protected]/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://[email protected]/

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?

5
  • 2
    This is working. Nice work, thanks for the help. I'd upvote but don't have enough rep :( Commented Nov 19, 2015 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! Commented Nov 19, 2015 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 Commented Nov 19, 2015 at 11:09
  • Not working anymore, it has been blocked by chrome for security reasons Commented Jun 13, 2018 at 17:51
  • 1
    @maxime Thanks for the update. I've edite my answer to include this information. Commented Jun 13, 2018 at 19:50

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.