Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 4248)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 4249)
@@ -188,5 +188,5 @@
         Main.pref.updateSystemProperties();
 
-        DefaultAuthenticator.createInstance(CredentialsManager.getInstance());
+        DefaultAuthenticator.createInstance();
         Authenticator.setDefault(DefaultAuthenticator.getInstance());
         ProxySelector.setDefault(new DefaultProxySelector(ProxySelector.getDefault()));
Index: trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java	(revision 4248)
+++ trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java	(revision 4249)
@@ -41,6 +41,6 @@
 public class CredentialDialog extends JDialog {
 
-    static public CredentialDialog getOsmApiCredentialDialog(String username, String password) {
-        CredentialDialog dialog = new CredentialDialog();
+    static public CredentialDialog getOsmApiCredentialDialog(String username, String password, String saveUsernameAndPasswordCheckboxText) {
+        CredentialDialog dialog = new CredentialDialog(saveUsernameAndPasswordCheckboxText);
         dialog.prepareForOsmApiCredentials(username, password);
         dialog.pack();
@@ -48,6 +48,6 @@
     }
 
-    static public CredentialDialog getHttpProxyCredentialDialog(String username, String password) {
-        CredentialDialog dialog = new CredentialDialog();
+    static public CredentialDialog getHttpProxyCredentialDialog(String username, String password, String saveUsernameAndPasswordCheckboxText) {
+        CredentialDialog dialog = new CredentialDialog(saveUsernameAndPasswordCheckboxText);
         dialog.prepareForProxyCredentials(username, password);
         dialog.pack();
@@ -57,4 +57,5 @@
     private boolean canceled;
     private CredentialPanel pnlCredentials;
+    String saveUsernameAndPasswordCheckboxText;
 
     public boolean isCanceled() {
@@ -93,5 +94,6 @@
     }
 
-    public CredentialDialog() {
+    public CredentialDialog(String saveUsernameAndPasswordCheckboxText) {
+        this.saveUsernameAndPasswordCheckboxText = saveUsernameAndPasswordCheckboxText;
         setModalityType(ModalityType.DOCUMENT_MODAL);
         try {
@@ -147,5 +149,5 @@
             tfUserName.addKeyListener(new TFKeyListener(owner, tfUserName, tfPassword));
             tfPassword.addKeyListener(new TFKeyListener(owner, tfPassword, tfUserName));
-            cbSaveCredentials =  new JCheckBox(tr("Save user and password (unencrypted)"));
+            cbSaveCredentials =  new JCheckBox(owner.saveUsernameAndPasswordCheckboxText);
 
             setLayout(new GridBagLayout());
@@ -301,4 +303,5 @@
         }
 
+        @Override
         public void keyPressed(KeyEvent e) {
             if(e.getKeyChar() == KeyEvent.VK_ENTER) {
@@ -317,7 +320,9 @@
         }
 
+        @Override
         public void keyReleased ( KeyEvent e ){
         }
 
+        @Override
         public void keyTyped ( KeyEvent e ){
         }
@@ -331,4 +336,5 @@
         }
 
+        @Override
         public void actionPerformed(ActionEvent arg0) {
             setCanceled(false);
@@ -349,4 +355,5 @@
         }
 
+        @Override
         public void actionPerformed(ActionEvent arg0) {
             cancel();
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java	(revision 4248)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java	(revision 4249)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.BorderLayout;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
@@ -15,8 +16,6 @@
 import javax.swing.JPasswordField;
 import javax.swing.JTextField;
-import javax.swing.text.html.HTMLEditorKit;
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.widgets.HtmlPanel;
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
 import org.openstreetmap.josm.io.auth.CredentialsAgent;
@@ -37,5 +36,6 @@
     /** the OSM password */
     private JPasswordField tfOsmPassword;
-
+    /** a panel with further information, e.g. some warnings */
+    private JPanel decorationPanel;
 
     /**
@@ -81,19 +81,6 @@
         gc.insets = new Insets(5,0,0,0);
         gc.fill = GridBagConstraints.BOTH;
-        HtmlPanel pnlMessage = new HtmlPanel();
-        HTMLEditorKit kit = (HTMLEditorKit)pnlMessage.getEditorPane().getEditorKit();
-        kit.getStyleSheet().addRule(".warning-body {background-color:rgb(253,255,221);padding: 10pt; border-color:rgb(128,128,128);border-style: solid;border-width: 1px;}");
-        pnlMessage.setText(
-                tr(
-                        "<html><body>"
-                        + "<p class=\"warning-body\">"
-                        + "<strong>Warning:</strong> The password is stored in plain text in the JOSM preferences file. "
-                        + "Furthermore, it is transferred <strong>unencrypted</strong> in every request sent to the OSM server. "
-                        + "<strong>Do not use a valuable password.</strong>"
-                        + "</p>"
-                        + "</body></html>"
-                )
-        );
-        add(pnlMessage, gc);
+        decorationPanel = new JPanel(new BorderLayout());
+        add(decorationPanel, gc);
     }
 
@@ -105,4 +92,6 @@
         CredentialsAgent cm = CredentialsManager.getInstance();
         try {
+            decorationPanel.removeAll();
+            decorationPanel.add(cm.getPreferencesDecorationPanel(), BorderLayout.CENTER);
             PasswordAuthentication pa = cm.lookup(RequestorType.SERVER);
             if (pa == null) {
Index: trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java	(revision 4248)
+++ trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java	(revision 4249)
@@ -47,6 +47,6 @@
             CredentialDialog dialog = null;
             switch(requestorType) {
-            case SERVER: dialog = CredentialDialog.getOsmApiCredentialDialog(username, password); break;
-            case PROXY: dialog = CredentialDialog.getHttpProxyCredentialDialog(username, password); break;
+            case SERVER: dialog = CredentialDialog.getOsmApiCredentialDialog(username, password, getSaveUsernameAndPasswordCheckboxText()); break;
+            case PROXY: dialog = CredentialDialog.getHttpProxyCredentialDialog(username, password, getSaveUsernameAndPasswordCheckboxText()); break;
             }
             dialog.setVisible(true);
@@ -80,3 +80,8 @@
     }
 
+    /**
+     * Provide the text for a checkbox that offers to save the
+     * username and password that has been entered by the user.
+     */
+    public abstract String getSaveUsernameAndPasswordCheckboxText();
 }
Index: trunk/src/org/openstreetmap/josm/io/auth/CredentialsAgent.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/CredentialsAgent.java	(revision 4248)
+++ trunk/src/org/openstreetmap/josm/io/auth/CredentialsAgent.java	(revision 4249)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.io.auth;
 
+import java.awt.Component;
 import java.net.PasswordAuthentication;
 import java.net.Authenticator.RequestorType;
@@ -28,5 +29,5 @@
      * @throws CredentialsAgentException thrown if a problem occurs in a implementation of this interface
      */
-    public PasswordAuthentication lookup(RequestorType requestorType) throws CredentialsAgentException;
+    PasswordAuthentication lookup(RequestorType requestorType) throws CredentialsAgentException;
 
     /**
@@ -38,5 +39,5 @@
      * @throws CredentialsManagerException thrown if a problem occurs in a implementation of this interface
      */
-    public void store(RequestorType requestorType, PasswordAuthentication credentials) throws CredentialsAgentException;
+    void store(RequestorType requestorType, PasswordAuthentication credentials) throws CredentialsAgentException;
 
     /**
@@ -49,5 +50,5 @@
 
      */
-    public CredentialsAgentResponse getCredentials(RequestorType requestorType, boolean noSuccessWithLastResponse) throws CredentialsAgentException;
+    CredentialsAgentResponse getCredentials(RequestorType requestorType, boolean noSuccessWithLastResponse) throws CredentialsAgentException;
 
     /**
@@ -58,5 +59,5 @@
      * @throws CredentialsAgentException thrown if something goes wrong
      */
-    public OAuthToken lookupOAuthAccessToken() throws CredentialsAgentException;
+    OAuthToken lookupOAuthAccessToken() throws CredentialsAgentException;
 
     /**
@@ -66,4 +67,12 @@
      * @throws CredentialsAgentException thrown if something goes wrong
      */
-    public void storeOAuthAccessToken(OAuthToken accessToken) throws CredentialsAgentException;
+    void storeOAuthAccessToken(OAuthToken accessToken) throws CredentialsAgentException;
+
+
+    /**
+     * Provide a Panel that is shown below the API password / username fields
+     * in the JOSM Preferences. (E.g. a warning that password is saved unencrypted.)
+     */
+    Component getPreferencesDecorationPanel();
+
 }
Index: trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java	(revision 4248)
+++ trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java	(revision 4249)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.io.auth;
 
+import java.awt.Component;
 import java.net.Authenticator.RequestorType;
 import java.net.PasswordAuthentication;
@@ -44,4 +45,6 @@
      * Plugins can register a CredentialsAgentFactory, thereby overriding
      * JOSM's default credentials agent.
+     * @param agentFactory The Factory that provides the custom CredentialsAgent.
+     * Can be null to clear the factory and switch back to default behavior.
      */
     public static void registerCredentialsAgentFactory(CredentialsAgentFactory agentFactory) {
@@ -84,3 +87,8 @@
         delegate.storeOAuthAccessToken(accessToken);
     }
+
+    @Override
+    public Component getPreferencesDecorationPanel() {
+        return delegate.getPreferencesDecorationPanel();
+    }
 }
Index: trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java	(revision 4248)
+++ trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java	(revision 4249)
@@ -22,18 +22,12 @@
     }
 
-    public static void createInstance(CredentialsAgent credentialManager) {
-        instance = new DefaultAuthenticator(credentialManager);
+    public static void createInstance() {
+        instance = new DefaultAuthenticator();
     }
 
-    private CredentialsAgent credentialsAgent;
     private final Map<RequestorType, Boolean> credentialsTried = new HashMap<RequestorType, Boolean>();
     private boolean enabled = true;
 
-    /**
-     *
-     * @param credentialsAgent the credential manager
-     */
-    private DefaultAuthenticator(CredentialsAgent credentialsAgent) {
-        this.credentialsAgent = credentialsAgent;
+    private DefaultAuthenticator() {
     }
 
@@ -55,5 +49,5 @@
             }
             boolean tried = credentialsTried.get(getRequestorType()) != null;
-            CredentialsAgentResponse response = credentialsAgent.getCredentials(getRequestorType(), tried);
+            CredentialsAgentResponse response = CredentialsManager.getInstance().getCredentials(getRequestorType(), tried);
             if (response == null || response.isCanceled())
                 return null;
Index: trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java	(revision 4248)
+++ trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java	(revision 4249)
@@ -2,10 +2,16 @@
 package org.openstreetmap.josm.io.auth;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Component;
 import java.net.PasswordAuthentication;
 import java.net.Authenticator.RequestorType;
+
+import javax.swing.text.html.HTMLEditorKit;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.oauth.OAuthToken;
 import org.openstreetmap.josm.gui.preferences.server.ProxyPreferencesPanel;
+import org.openstreetmap.josm.gui.widgets.HtmlPanel;
 
 /**
@@ -101,3 +107,28 @@
         }
     }
+
+    @Override
+    public Component getPreferencesDecorationPanel() {
+        HtmlPanel pnlMessage = new HtmlPanel();
+        HTMLEditorKit kit = (HTMLEditorKit)pnlMessage.getEditorPane().getEditorKit();
+        kit.getStyleSheet().addRule(".warning-body {background-color:rgb(253,255,221);padding: 10pt; border-color:rgb(128,128,128);border-style: solid;border-width: 1px;}");
+        pnlMessage.setText(
+                tr(
+                        "<html><body>"
+                        + "<p class=\"warning-body\">"
+                        + "<strong>Warning:</strong> The password is stored in plain text in the JOSM preferences file. "
+                        + "Furthermore, it is transferred <strong>unencrypted</strong> in every request sent to the OSM server. "
+                        + "<strong>Do not use a valuable password.</strong>"
+                        + "</p>"
+                        + "</body></html>"
+                )
+        );
+        return pnlMessage;
+    }
+    
+    @Override
+    public String getSaveUsernameAndPasswordCheckboxText() {
+        return tr("Save user and password (unencrypted)");
+    }
+    
 }
