Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 19094)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 19095)
@@ -38,4 +38,5 @@
 import org.openstreetmap.josm.data.preferences.ColorInfo;
 import org.openstreetmap.josm.data.preferences.JosmBaseDirectories;
+import org.openstreetmap.josm.data.preferences.JosmUrls;
 import org.openstreetmap.josm.data.preferences.NamedColorProperty;
 import org.openstreetmap.josm.data.preferences.PreferencesReader;
@@ -43,4 +44,5 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.io.NetworkManager;
+import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.spi.preferences.AbstractPreferences;
 import org.openstreetmap.josm.spi.preferences.Config;
@@ -911,4 +913,10 @@
             modifiedDefault = false;
         }
+        // As of June 1st, 2024, the OSM.org instance no longer allows basic authentication.
+        if (JosmUrls.getInstance().getDefaultOsmApiUrl().equals(OsmApi.getOsmApi().getServerUrl()) && "basic".equals(OsmApi.getAuthMethod())) {
+            put("osm-server.auth-method", null);
+            put("osm-server.username", null);
+            put("osm-server.password", null);
+        }
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java	(revision 19094)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java	(revision 19095)
@@ -18,5 +18,4 @@
 import javax.swing.JRadioButton;
 
-import org.openstreetmap.josm.actions.ExpertToggleAction;
 import org.openstreetmap.josm.data.UserIdentityManager;
 import org.openstreetmap.josm.data.oauth.OAuthAccessTokenHolder;
@@ -47,13 +46,4 @@
     /** the panel for the OAuth 2.0 authentication parameters */
     private OAuthAuthenticationPreferencesPanel pnlOAuth20Preferences;
-
-    /** Used to determine which API we are using for disabling/enabling Basic Auth/OAuth 1.0a */
-    private String apiUrl = OsmApi.getOsmApi().getServerUrl();
-    /** ExpertToggleAction uses weak references; we don't want this listener to be garbage collected */
-    private final ExpertToggleAction.ExpertModeChangeListener expertModeChangeListener = isExpert -> {
-        final String authMethod = OsmApi.getAuthMethod();
-        final boolean defaultApi = JosmUrls.getInstance().getDefaultOsmApiUrl().equals(apiUrl);
-        rbBasicAuthentication.setEnabled(rbBasicAuthentication.isSelected() || "basic".equals(authMethod) || isExpert || !defaultApi);
-    };
 
     /**
@@ -109,7 +99,6 @@
         pnlOAuth20Preferences = new OAuthAuthenticationPreferencesPanel(OAuthVersion.OAuth20);
 
-        ExpertToggleAction.addExpertModeChangeListener(expertModeChangeListener, true);
-
         pnlAuthenticationParameters.add(pnlOAuth20Preferences, BorderLayout.CENTER);
+        this.updateAcceptableAuthenticationMethods(OsmApi.getOsmApi().getServerUrl());
     }
 
@@ -167,5 +156,4 @@
             }
         }
-        ExpertToggleAction.removeExpertModeChangeListener(this.expertModeChangeListener);
     }
 
@@ -196,7 +184,17 @@
         }
         if (OsmApiUrlInputPanel.API_URL_PROP.equals(evt.getPropertyName())) {
-            this.apiUrl = (String) evt.getNewValue();
-            this.expertModeChangeListener.expertChanged(ExpertToggleAction.isExpert());
-        }
-    }
+            this.updateAcceptableAuthenticationMethods((String) evt.getNewValue());
+        }
+    }
+
+    /**
+     * Update the acceptable authentications methods
+     * @param apiUrl The API url to check
+     */
+    private void updateAcceptableAuthenticationMethods(String apiUrl) {
+        final String authMethod = OsmApi.getAuthMethod();
+        final boolean defaultApi = JosmUrls.getInstance().getDefaultOsmApiUrl().equals(apiUrl);
+        rbBasicAuthentication.setEnabled(rbBasicAuthentication.isSelected() || "basic".equals(authMethod) || !defaultApi);
+    }
+
 }
