up vote 1 down vote favorite
2
share [g+] share [fb]

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.

link|improve this question
feedback

4 Answers

up vote 0 down vote accepted

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.

link|improve this 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
feedback

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.

link|improve this answer
I am afraid the unattended parts are not available on linux: wiki.imacros.net/Web_Scripting#How_to_run_iMacros_unattended – golemwashere Sep 25 '09 at 9:14
feedback

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

link|improve this answer
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
feedback

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".

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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