Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

5 Answers 5

up vote 1 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.

share|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

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.

share|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

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

share|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

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

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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