107

I am using KeePass version 2.19. What I would like to do is have more than just one URL address associated with a given user name and password.

The entry for a given website might look something like this...

Title
google

User Name
email

Password
pass

URL
https://accounts.google.com/ServiceLogin?hl=en&continue=https://www.google.com/
https://accounts.google.com/ServiceLogin?hl=sv&continue=https://www.google.com/
https://accounts.google.com/ServiceLogin?hl=de&continue=https://www.google.com/

As you can see the ?hl=en changes into ?hl=sv and then to ?hl=de for the three different languages in which I wish to view the Google log-in page.

But this of course could be something completely different, like different web services from the same provider like YouTube and Gmail by Google. Very much like SE where you have several websites but only use one user name and password.

I imagine something along the lines of having multiple entries for one and the same website, where KeePass would actually prompt you to choose which one you want to use. So you have several user names and passwords that use the same URL. But is it possible to have several URLs using the same user name and password, so that KeePass asks me "to which of the following three URLs do you want to auto-log into with this password"?

3
  • 5
    For this case you could just use accounts.google.com/ServiceLogin as the URL and it will match all the above cases
    – Zero
    Oct 14, 2015 at 2:12
  • 2
    This happens much more often for ssh:// and scp://
    – kubanczyk
    Feb 25, 2018 at 22:45
  • 1
    See my answer for a modern solution that doesn't require duplicating references.
    – colan
    Jun 8, 2020 at 16:27

5 Answers 5

102

You can create a copy of a password entry:

enter image description here

And then only use references for username and password in the new entry:

enter image description here

Then, adjust the URL in the new entry.

8
  • Perfect! So when I want to change the password I can only change it in the original entry? I'm thinking what if I have different titles for all the three, how to find the original one. But I guess that's only a matter of getting used to this and having some meaningful titles that are easy to find.
    – Samir
    Jun 7, 2012 at 21:58
  • 2
    I'm wondering if there is another option, since the menu entry says URL(s) > implying that it should be possible to have multiple URLs.
    – kapex
    Aug 5, 2014 at 13:39
  • 3
    @kapep After inspecting the source, it is my understanding that the label says "URL(s)" because the actions in it can apply to all currently selected password entries. I didn't see anything that would indicate multiple URLs being supported in a single password entry. Aug 8, 2014 at 14:41
  • 2
    See my modern answer for a way to do this without adding duplicating references.
    – colan
    Jun 24, 2020 at 16:38
  • 1
    @colan Hah nice. I switched to KeePassXC yesterday for other reasons. Upvoted your answer :) Jun 25, 2020 at 12:16
71

Switch to KeePassXC. As of the 2.5.0 release, this now works as you would expect.

The new Browser Integration entry settings page has a list view with any additional URL's. These URL's are added to the entry attributes with KP2A_URL_, which means those are directly compatible with Keepass2Android.

enter image description here

7
34

The answer from Oliver Salzburg is very good.

Complementing it, if you already have an entry and want to link another entry, go to the entry, properties, then tools, insert field reference and link to the type you need.

See an example here:
enter image description here

1
  • 1
    See my modern answer for a way to do this without adding duplicating references.
    – colan
    Jun 24, 2020 at 16:39
2

If you want to use multiple URLs in order to Auto-Type when you are on those URLs, you don't need to create copies with field references; they can be added in the Auto-Type settings.


If you use KeePass as a sort of bookmark manager for login pages, so you open URLs from KeePass and then login, rather than browsing to the login page in your browser and use KeePass's auto-type, then indeed creating multiple entries is what you want. (Your usage of full URL https://accounts.google.com/ServiceLogin?hl=en&continue=https://www.google.com/ rather than just https://accounts.google.com/ seems to suggest this.) Otherwise, this answer, with one entry per account matching multiple URLs might be a cleaner solution.


If you use KeePass with no plugins, then you presumably use a plugin/extension on the browser instead, i.e. a URL in Title Bar extension to add the current URL to the browser's window title, with either of these KeePass settings enabled:

  • An entry matches if its URL is contained in the target window title
  • An entry matches if the host component of its URL is contained in the target window title

keepass_settings

In the case where the desired multiple URLs are exactly as described in the question, with the same domain name, the solution is simple, either use the domain (https://accounts.google.com/) as the URL, or check the second setting above.

But if you don't want to do either of these, or if the different URLs that you want to match are on different domains, then they can be added in the Auto-Type settings. For example, you have an entry with https://superuser.com/ as the URL. You want to use the same account on https://stackoverflow.com/. Then go to the Entry's Auto-Type settings, click "Add" at "Use custom sequences for specific windows:"

auto-type

Enter *https://stackoverflow.com/* in "Target window", and leave the second setting at "Use default keystroke sequence of the entry", unless this particular page requires a different auto-type pattern.

custom_auto-type

(Normally Title/URL can match if contained anywhere in a window's title, putting asterisks on both sides of the second URL replicates this behavior.)

Regular expressions are supported, so if you want to match all Stack Exchange sites, you can use //https://[a-z]*\.?stackexchange\.com/.*// as a third URL, which matches https://stackexchange.com/anypath as well as https://subdomain.stackexchange.com/anypath. (You could also use *stackexchange.com/* without using regular expressions; but this would also match https://evilsite.com/phishing/stackexchange.com/)


If you don't use a browser extension to add the URL in window title, you use a KeePass plugin to match URLs, like I do, e.g. WebAutoType (Website). Then, the process of adding a second URL is similar, in the Auto-Type settings, but it is added explicitly as a URL:

custom_auto-type_plugin

This time, an asterisk is only needed at the end (https://stackoverflow.com/*), as it compares it explicitly to the address in the browser. If you want to match specifically to a single page rather than a domain, no asterisk is needed.

Again, regular expressions are supported, so you can use //https://[a-z]*\.?stackexchange\.com/.*//. But since v6.1 (2019-06-15), WebAutoType has intelligent URL field matching, whereby:

Rather than just starts-with, it will now try and match any URL that has the URL field value as a base, now including sub-domains.

This is specifically for the URL field, not other custom Auto-Type settings you add. So you can just use https://stackexchange.com/ in the entry's URL field, and https://superuser.com/* and https://stackoverflow.com/* as the second and third URLs, thus matching all Stack Exchange sites without needing regular expressions.

0

A friendly approach with GUI oriented users in mind is using a KeePassRPC Plugin & Kee Browser extension The Kee browser extension is currently available for Firefox and Chrome, I've also tested it successfully on MS-Edge.

HOWTO:
Install KeePassRPC: It will add a 'Kee' tab in your entries and supplement its properties there: screenshot of the added 'kee' tab in KeePass

You will find "URLs" within this tab. Add any number of secondary URLs here: screenshot of the 'Kee'/URL tab with an example filled out

The Kee browser add-in will source these properties and propose to fill in your credentials whenever a primary or secondary URL is matched: example of an autofilled form at superuser.com

Benefit of the approach is, that the setup will work without regex or technical knowledge on the user side. The Functionally becomes available whenever KeePassRPC + Kee browser extension is installed.

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Oct 13, 2022 at 14:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .