mitchellh/vagrant — pull request #1147 by gabetax (2012-11-20 06:43:37+00:00)
Title: Keyboard interactive authentication for HTTP downloads of boxes

Say I have a Vagrantfile with:

config.vm.box_url = "https://secure.example.com/private.box"

and https://secure.example.com/ requires basic HTTP authentication. Currenlty when you run `vagrant up` you will see:

$ vagrant up
[default] Box base was not found. Fetching box from specified URL...
[vagrant] Downloading with Vagrant::Downloaders::HTTP...
[vagrant] Downloading box: https://secure.example.com/private.box
Bad status code: 401

Please verify that the box exists and is accessible. Also verify that
this computer is properly connected to the internet.

You can currently embed a username and password into the URL (as of https://github.com/mitchellh/vagrant/pull/521), e.g.

config.vm.box_url = "https://john:mypassword@secure.example.com/private.box"

However, I wouldn't want to commit a login into source control, especially if the logins were employee specific. You can have people work around this by editing the Vagrantfile to temporarily insert their login for running `vagrant up`, or you could have them separately download and `vagrant add` the box, but both of these methods are inconvenient. Ideally I would like to be prompted for my login information if `Vagrant::Downloaders::HTTP` encounters a 401 response.