4

I have an Ubuntu workstation with Firefox always open on a (autorefreshing) web page protected by basic auth.

At startup, I have autologin and automatic Firefox start on the page and I have saved the basic auth credentials.

I'd like to confirm in some automated way the username/password dialog box which pops up on the first opening of the page, or I'd like to know if there's any hack to avoid this dialog box.

I tried setting the homepage to http://username%3Apassword@myserver/mypage put that doesn't stop confirmation dialog boxes.

1

Try xdotool or IronAHK. I haven't used either of them, but they're basically tools for simulating mouse and keyboard events, which sounds like one way of solving your problem.

Edit: See the comments for the exact answer.

  • Yay! it works with WID=xdotool search "Authentication Required" | head -1 xdotool windowfocus $WID xdotool key Return Thanks – golemwashere Oct 7 '09 at 10:17
2

For people coming from google:

The easiest way to prevent that annoying popup is to got to "about":config" and add a new integer entry:
Name: network.http.phishy-userpass-length
Value: 255

With this in place you can then use http://username:password@myserver/mypage and there will be no confirmation boxes. More information can be found at http://kb.mozillazine.org/Network.http.phishy-userpass-length

1

There is an automation addon for firefox called iMacros.
I have not used it first hand and cannot vouch it it will help you solve your problem.
You could give it a short try.

0

PasswordProfiler is protection like this is very weak and a smart user can bypass it easily.

  • I do not need to secure this workstation, it's in a safe and locked place available only to authorized people, the problem is automating the password submission. – golemwashere Sep 25 '09 at 6:55
  • FYI to those with edit authority, link is dead – Jax May 12 '10 at 17:13
0

xdotool is really useful! Thanks!

This is my script in Ubuntu Karmic. I have a key combination that launches this code, so I can get really fast to a htaccess password protected site:

#!/bin/bash

#If Firefox is not running, wait 4 seconds to open.       
if [ "$(pidof firefox)" ]
  then
    timetosleep=1
  else
    timetosleep=4
fi

#Launch firefox
firefox http://wiki.example.org &

#Sleep until the window comes up
sleep $timetosleep

#Press enter!
WID=`xdotool search --title Identi`
xdotool windowactivate $WID
xdotool key Return

PD: As my firefox is in spanish I search for "Identificación" instead of "Authentication".

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.