3

I have a bunch of dev domains that are all subdomains of example.com e.g. test1.example.com, test2.example.com etc

They all use HTTP authentication and the same username and password. Is there a way of adding a wildcard username and password to my mac keychain?

Tom
  • 411

3 Answers3

2

They all use HTTP authentication

If that is HTTP Basic Authentication then I think you're out of luck (and your credentials are sent in an insecure way when not using HTTPS). But, if it is HTTP Digest Authentication then you can fix it on the server, assuming you can control those development servers and have a limited number of domains.

For Apache see directive AuthDigestDomain in mod_auth_digest:

The specified URIs are prefixes; the client will assume that all URIs "below" these are also protected by the same username/password.
[..]
The URIs specified can also point to different servers, in which case clients (which understand this) will then share username/password info across multiple servers without prompting the user each time.

(See also domain as defined in "3.2.1 The WWW-Authenticate Response Header" of RFC 2617. See also Apache .htaccess trick to authenticate only once for all subdomains? on Stack Overflow. Note that old versions of IE have some issues.)

Arjan
  • 31,511
2

The Keychain and Safari's built-in password manager does not support wildcards, as far as I know.

An alternative would be 1Password, a third-party password manager that integrates with Safari, Firefox, and other browsers and does support wildcards. (Actually, it will offer to autofill a password for any subdomain of the domain associated with the password.) It's not as simple or straightforward to use as what's built in, but is definitely worth a look.

s4y
  • 3,859
0

I went ahead and filed a bug on Firefox for this. Surprised it wasn't filed already: https://bugzilla.mozilla.org/show_bug.cgi?id=589628

mlissner
  • 1,292