Index: applications/editors/josm/plugins/native-password-manager/build.xml
===================================================================
--- applications/editors/josm/plugins/native-password-manager/build.xml	(revision 27366)
+++ applications/editors/josm/plugins/native-password-manager/build.xml	(revision 27367)
@@ -33,5 +33,5 @@
     <property name="commit.message" value="Commit message"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="4549"/>
+    <property name="plugin.main.version" value="4692"/>
 
     <!--
Index: applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/InitializationWizard.java
===================================================================
--- applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/InitializationWizard.java	(revision 27366)
+++ applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/InitializationWizard.java	(revision 27367)
@@ -47,4 +47,5 @@
 import org.openstreetmap.josm.io.auth.CredentialsAgentException;
 import org.openstreetmap.josm.io.auth.CredentialsManager;
+import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.PlatformHookOsx;
@@ -354,5 +355,5 @@
             if (server_username != null || server_password != null) {
                 try {
-                    cm.store(RequestorType.SERVER, new PasswordAuthentication(string(server_username), toCharArray(server_password)));
+                    cm.store(RequestorType.SERVER, OsmApi.getOsmApi().getHost(), new PasswordAuthentication(string(server_username), toCharArray(server_password)));
                     if (rbClear.isSelected()) {
                         Main.pref.put("osm-server.username", null);
@@ -366,7 +367,8 @@
             String proxy_username = Main.pref.get(ProxyPreferencesPanel.PROXY_USER, null);
             String proxy_password = Main.pref.get(ProxyPreferencesPanel.PROXY_PASS, null);
+            String proxy_host = Main.pref.get(ProxyPreferencesPanel.PROXY_HTTP_HOST, null);
             if (proxy_username != null || proxy_password != null) {
                 try {
-                    cm.store(RequestorType.PROXY, new PasswordAuthentication(string(proxy_username), toCharArray(proxy_password)));
+                    cm.store(RequestorType.PROXY, proxy_host, new PasswordAuthentication(string(proxy_username), toCharArray(proxy_password)));
                     if (rbClear.isSelected()) {
                         Main.pref.put(ProxyPreferencesPanel.PROXY_USER, null);
Index: applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMCredentialsAgent.java
===================================================================
--- applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMCredentialsAgent.java	(revision 27366)
+++ applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMCredentialsAgent.java	(revision 27367)
@@ -21,4 +21,5 @@
 import org.openstreetmap.josm.gui.preferences.server.ProxyPreferencesPanel;
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
+import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.io.auth.AbstractCredentialsAgent;
 import org.openstreetmap.josm.io.auth.CredentialsAgentException;
@@ -95,5 +96,5 @@
     
     @Override
-    public PasswordAuthentication lookup(RequestorType rt) throws CredentialsAgentException {
+    public PasswordAuthentication lookup(RequestorType rt, String host) throws CredentialsAgentException {
         PasswordAuthentication cache = credentialsCache.get(rt);
         if (cache != null) 
@@ -104,6 +105,11 @@
         switch(rt) {
             case SERVER:
-                user = stringNotNull(getProvider().read(getServerDescriptor()+".username"));
-                password = getProvider().read(getServerDescriptor()+".password");
+                if(OsmApi.getOsmApi().getHost().equals(host)) {
+                    user = stringNotNull(getProvider().read(getServerDescriptor()+".username"));
+                    password = getProvider().read(getServerDescriptor()+".password");
+                } else {
+                    user = stringNotNull(getProvider().read(host+".username"));
+                    password = getProvider().read(host+".password");
+                }
                 auth = new PasswordAuthentication(user, password == null ? new char[0] : password);
                 break;
@@ -120,5 +126,5 @@
 
     @Override
-    public void store(RequestorType rt, PasswordAuthentication credentials) throws CredentialsAgentException {
+    public void store(RequestorType rt, String host, PasswordAuthentication credentials) throws CredentialsAgentException {
         char[] username, password;
         if (credentials == null) {
@@ -136,7 +142,13 @@
         switch(rt) {
             case SERVER:
-                prefix = getServerDescriptor();
-                usernameDescription = tr("JOSM/OSM API/Username");
-                passwordDescription = tr("JOSM/OSM API/Password");
+                if(OsmApi.getOsmApi().getHost().equals(host)) {
+                    prefix = getServerDescriptor();
+                    usernameDescription = tr("JOSM/OSM API/Username");
+                    passwordDescription = tr("JOSM/OSM API/Password");
+                } else {
+                    prefix = host;
+                    usernameDescription = tr("{0}/Username", host);
+                    passwordDescription = tr("{0}/Password", host);
+                }
                 break;
             case PROXY:
