diff --git src/org/openstreetmap/josm/data/Preferences.java src/org/openstreetmap/josm/data/Preferences.java
index 48cb104644..c9553a5da8 100644
--- src/org/openstreetmap/josm/data/Preferences.java
+++ src/org/openstreetmap/josm/data/Preferences.java
@@ -85,7 +85,8 @@ public class Preferences extends AbstractPreferences {
 
     /** remove if key equals */
     private static final String[] OBSOLETE_PREF_KEYS = {
-        // nothing ATM
+        "oauth.access-token.key", // OAuth 1.0a token, unused since OAuth 1.0a was removed (#22810). To remove end of 2027
+        "oauth.access-token.secret", // OAuth 1.0a token, unused since OAuth 1.0a was removed (#22810). To remove end of 2027
     };
 
     /** remove if key starts with */
diff --git src/org/openstreetmap/josm/data/UserIdentityManager.java src/org/openstreetmap/josm/data/UserIdentityManager.java
index 36b20a9ec0..62b024d401 100644
--- src/org/openstreetmap/josm/data/UserIdentityManager.java
+++ src/org/openstreetmap/josm/data/UserIdentityManager.java
@@ -85,8 +85,6 @@ public final class UserIdentityManager implements PreferenceChangedListener {
 
     private String userName;
     private UserInfo userInfo;
-    private boolean accessTokenKeyChanged;
-    private boolean accessTokenSecretChanged;
 
     private UserIdentityManager() {
     }
@@ -296,27 +294,15 @@ public final class UserIdentityManager implements PreferenceChangedListener {
                 setPartiallyIdentified(getUserName());
             }
             break;
-        case "oauth.access-token.key":
-            accessTokenKeyChanged = true;
-            break;
-        case "oauth.access-token.secret":
-            accessTokenSecretChanged = true;
-            break;
-        default: // Do nothing
-            if (evt.getKey() != null && evt.getKey().equals("oauth.access-token.parameters.OAuth20." + OsmApi.getOsmApi().getHost())) {
-                accessTokenKeyChanged = true;
-                accessTokenSecretChanged = true;
-            }
-        }
-        // oauth.access-token.parameters.OAuth20.api.openstreetmap.org
-
-        if (accessTokenKeyChanged && accessTokenSecretChanged) {
-            accessTokenKeyChanged = false;
-            accessTokenSecretChanged = false;
-            if (OsmApi.isUsingOAuthAndOAuthSetUp(OsmApi.getOsmApi())) {
-                getInstance().initFromOAuth();
-            } else if (OsmApi.isUsingOAuth()) {
-                setAnonymous();
+        default:
+            // the OAuth 2 token of the current server was stored or removed, e.g. oauth.access-token.object.OAuth20.api.openstreetmap.org;
+            // its parameters are kept when it is removed, so they do not tell
+            if (("oauth.access-token.object.OAuth20." + OsmApi.getOsmApi().getHost()).equals(evt.getKey())) {
+                if (OsmApi.isUsingOAuthAndOAuthSetUp(OsmApi.getOsmApi())) {
+                    getInstance().initFromOAuth();
+                } else if (OsmApi.isUsingOAuth()) {
+                    setAnonymous();
+                }
             }
         }
     }
diff --git src/org/openstreetmap/josm/data/oauth/OAuth20Parameters.java src/org/openstreetmap/josm/data/oauth/OAuth20Parameters.java
index 0214627dad..a665acbb02 100644
--- src/org/openstreetmap/josm/data/oauth/OAuth20Parameters.java
+++ src/org/openstreetmap/josm/data/oauth/OAuth20Parameters.java
@@ -15,6 +15,8 @@ import jakarta.json.JsonStructure;
 import jakarta.json.JsonValue;
 
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
  * Parameters for OAuth 2.0
@@ -130,10 +132,26 @@ public final class OAuth20Parameters implements IOAuthParameters {
         return this.apiUrl;
     }
 
+    /**
+     * {@inheritDoc}
+     * <p>
+     * The parameters are stored under the host of the API, where the access token of the server stores its
+     * parameters as well.
+     */
     @Override
     public void rememberPreferences() {
-        Config.getPref().put("oauth.access-token.parameters." + OAuthVersion.OAuth20 + "." + this.apiUrl,
-                this.toPreferencesString());
+        if (Utils.isEmpty(this.apiUrl)) {
+            // there is no server to store them for
+            Logging.warn("OAuth parameters of client id {0} have no API URL and are not stored", this.clientId);
+            return;
+        }
+        final String key = OAuthParameters.getPreferenceKey(this.apiUrl);
+        Config.getPref().put(key, this.toPreferencesString());
+        // earlier versions of JOSM stored them under the API URL
+        final String apiUrlKey = "oauth.access-token.parameters." + OAuthVersion.OAuth20 + "." + this.apiUrl;
+        if (!key.equals(apiUrlKey)) {
+            Config.getPref().put(apiUrlKey, null);
+        }
     }
 
     @Override
diff --git src/org/openstreetmap/josm/data/oauth/OAuth20Token.java src/org/openstreetmap/josm/data/oauth/OAuth20Token.java
index c27d35eab9..06ff53079b 100644
--- src/org/openstreetmap/josm/data/oauth/OAuth20Token.java
+++ src/org/openstreetmap/josm/data/oauth/OAuth20Token.java
@@ -51,6 +51,27 @@ public final class OAuth20Token implements IOAuthToken {
         this(oauthParameters, new InputStreamReader(new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8));
     }
 
+    /**
+     * Create a bearer token from the access token alone, such as a token issued outside JOSM and pasted by the user.
+     * It has no refresh token, and works with nothing else: the parameters only need the API URL the token is for.
+     * @param oauthParameters The parameters for the OAuth token
+     * @param accessToken The access token
+     * @return The bearer token
+     * @since xxx
+     */
+    public static OAuth20Token fromAccessToken(IOAuthParameters oauthParameters, String accessToken) {
+        final String json = Json.createObjectBuilder()
+                .add(ACCESS_TOKEN, accessToken)
+                .add(TOKEN_TYPE, "bearer")
+                .build().toString();
+        try {
+            return new OAuth20Token(oauthParameters, json);
+        } catch (OAuth20Exception e) {
+            // both required fields are present
+            throw new JosmRuntimeException(e);
+        }
+    }
+
     OAuth20Token(IOAuthParameters oauthParameters, Reader bufferedReader) throws OAuth20Exception {
         this.oauthParameters = oauthParameters;
         try (JsonReader reader = Json.createReader(bufferedReader)) {
diff --git src/org/openstreetmap/josm/data/oauth/OAuthParameters.java src/org/openstreetmap/josm/data/oauth/OAuthParameters.java
index c3e23f4d25..85a497f04e 100644
--- src/org/openstreetmap/josm/data/oauth/OAuthParameters.java
+++ src/org/openstreetmap/josm/data/oauth/OAuthParameters.java
@@ -36,6 +36,8 @@ public final class OAuthParameters {
     private static final String OSM_API_DEFAULT = "https://api.openstreetmap.org/api";
     private static final String OSM_API_DEV = "https://api06.dev.openstreetmap.org/api";
     private static final String OSM_API_MASTER = "https://master.apis.dev.openstreetmap.org/api";
+    /** Whether the default parameters are used; one setting for each host, with the setting for all hosts as fallback */
+    private static final String USE_DEFAULT = "oauth.settings.use-default";
 
     private OAuthParameters() {
         // Hide constructor
@@ -80,10 +82,11 @@ public final class OAuthParameters {
 
     /**
      * Get the OAuth 2.0 parameters the user entered in the advanced OAuth settings and saved with
-     * {@link IOAuthParameters#rememberPreferences()}. Until a token exists, this is the only place a
-     * client id for a server not in {@link #createDefault(String, OAuthVersion)} can come from.
-     * {@link OAuth20Parameters#rememberPreferences()} keys by the API URL as given; callers may pass
-     * either the URL or its host, so both are tried.
+     * {@link IOAuthParameters#rememberPreferences()}, or the parameters of the access token of the server. Until a
+     * token exists, this is the only place a client id for a server not in
+     * {@link #createDefault(String, OAuthVersion)} can come from.
+     * {@link OAuth20Parameters#rememberPreferences()} keys by the host of the API, as the access token is; earlier
+     * versions of JOSM keyed them by the API URL, so callers pass that too.
      * @param keys The preference key suffixes to try, in order
      * @return The remembered parameters, or {@code null} if none are saved or they cannot be parsed
      * @since 19627
@@ -110,12 +113,74 @@ public final class OAuthParameters {
         return null;
     }
 
+    /**
+     * Get the preference key under which the OAuth 2.0 parameters for the server of an API are stored. This is the
+     * key of the access token of that server too, see {@link org.openstreetmap.josm.io.auth.CredentialsAgent}.
+     * @param apiUrl The API URL, or the host of the API
+     * @return The preference key
+     * @since xxx
+     */
+    static String getPreferenceKey(String apiUrl) {
+        return "oauth.access-token.parameters." + OAuthVersion.OAuth20 + "." + getHost(apiUrl);
+    }
+
+    /**
+     * Get the host of an API, which is what the OAuth settings and the access token of a server are stored under.
+     * @param apiUrl The API URL, or the host of the API
+     * @return The host, or {@code apiUrl} itself if it is not a URL (including {@code null})
+     * @since xxx
+     */
+    public static String getHost(String apiUrl) {
+        if (Utils.isEmpty(apiUrl)) {
+            return apiUrl;
+        }
+        try {
+            final String host = new URI(apiUrl).getHost();
+            return host == null ? apiUrl : host;
+        } catch (URISyntaxException e) {
+            Logging.trace(e);
+            return apiUrl;
+        }
+    }
+
+    /**
+     * Determines whether the default OAuth 2.0 parameters are used for the server of an API, that is the ones built
+     * into JOSM or published by the server, rather than the ones the user entered in the advanced OAuth settings.
+     * <p>
+     * This is a setting of each server. Until it is set for a server, the setting earlier versions of JOSM had
+     * for all servers is used.
+     * @param apiUrl The API URL, or the host of the API
+     * @return {@code true} if the default parameters are used
+     * @since xxx
+     */
+    public static boolean isUseDefault(String apiUrl) {
+        final boolean useDefaultForAll = Config.getPref().getBoolean(USE_DEFAULT, true);
+        if (Utils.isEmpty(apiUrl)) {
+            return useDefaultForAll;
+        }
+        return Config.getPref().getBoolean(USE_DEFAULT + "." + getHost(apiUrl), useDefaultForAll);
+    }
+
+    /**
+     * Sets whether the default OAuth 2.0 parameters are used for the server of an API.
+     * @param apiUrl The API URL, or the host of the API
+     * @param useDefault {@code true} to use the default parameters, {@code false} to use the ones the user entered
+     * @see #isUseDefault(String)
+     * @since xxx
+     */
+    public static void setUseDefault(String apiUrl, boolean useDefault) {
+        if (!Utils.isEmpty(apiUrl)) {
+            Config.getPref().putBoolean(USE_DEFAULT + "." + getHost(apiUrl), useDefault);
+        }
+    }
+
     private static JsonObject getRFC8414Parameters(String apiUrl) {
         HttpClient client = null;
         try {
             final URI apiURI = new URI(apiUrl);
-            final URL rfc8414URL = new URI(apiURI.getScheme(), apiURI.getHost(),
-                    "/.well-known/oauth-authorization-server", null).toURL();
+            // keep the port, as for a development server on http://localhost:3000
+            final URL rfc8414URL = new URI(apiURI.getScheme(), null, apiURI.getHost(), apiURI.getPort(),
+                    "/.well-known/oauth-authorization-server", null, null).toURL();
             client = HttpClient.create(rfc8414URL);
             HttpClient.Response response = client.connect();
             if (response.getResponseCode() == 200) {
@@ -146,7 +211,6 @@ public final class OAuthParameters {
         final String clientId;
         final String clientSecret;
         final String redirectUri = "http://127.0.0.1:8111/oauth_authorization";
-        final String baseUrl;
         apiUrl = OsmApi.normalizeApiUrl(apiUrl == null ? OsmApi.getOsmApi().getServerUrl() : apiUrl);
         switch (apiUrl) {
             case OSM_API_DEV:
@@ -180,7 +244,6 @@ public final class OAuthParameters {
                 clientId = "";
                 clientSecret = null;
         }
-        baseUrl = apiUrl;
         // Check if the server is RFC 8414 compliant
         try {
             synchronized (RFC8414_RESPONSES) {
@@ -207,8 +270,21 @@ public final class OAuthParameters {
         } catch (OAuthException e) {
             Logging.trace(e);
         }
-        // Fall back to guessing the parameters.
-        return new OAuth20Parameters(clientId, clientSecret, baseUrl, apiUrl, redirectUri);
+        // Fall back to the endpoints of openstreetmap-website, which is what OSM API servers run
+        return new OAuth20Parameters(clientId, clientSecret, getWebsite(apiUrl) + "/oauth2", apiUrl, redirectUri);
+    }
+
+    /**
+     * Get the website of an OSM API server, where openstreetmap-website has its OAuth 2.0 endpoints: the API URL
+     * without its {@code /api}, except for the default OSM API, which is served from a host of its own.
+     * @param apiUrl The normalized API URL
+     * @return The website URL
+     */
+    private static String getWebsite(String apiUrl) {
+        if (OSM_API_DEFAULT.equals(apiUrl)) {
+            return Config.getUrls().getOSMWebsite();
+        }
+        return apiUrl.replaceAll("/api$", "");
     }
 
     /**
@@ -230,7 +306,9 @@ public final class OAuthParameters {
     }
 
     /**
-     * Replies a set of parameters as defined in the preferences.
+     * Replies a set of parameters as defined in the preferences: the parameters of the access token of the server,
+     * otherwise the parameters the user entered, unless the server is set to {@link #isUseDefault(String) use the
+     * default parameters}, otherwise the {@link #createDefault(String, OAuthVersion) default parameters}.
      *
      * @param oAuthVersion The OAuth version to use.
      * @param apiUrl the API URL. Must not be {@code null}.
@@ -239,33 +317,29 @@ public final class OAuthParameters {
      */
     public static IOAuthParameters createFromApiUrl(String apiUrl, OAuthVersion oAuthVersion) {
         apiUrl = OsmApi.normalizeApiUrl(apiUrl);
-        final String originalApiUrl = apiUrl;
         // We actually need the host
-        if (apiUrl.startsWith("https://") || apiUrl.startsWith("http://")) {
-            try {
-                apiUrl = new URI(apiUrl).getHost();
-            } catch (URISyntaxException syntaxException) {
-                Logging.trace(apiUrl);
-            }
-        }
+        final String host = getHost(apiUrl);
         switch (oAuthVersion) {
             case OAuth20:
             case OAuth21: // Right now, OAuth 2.1 will work with our OAuth 2.0 implementation
                 try {
-                    IOAuthToken storedToken = CredentialsManager.getInstance().lookupOAuthAccessToken(apiUrl);
+                    IOAuthToken storedToken = CredentialsManager.getInstance().lookupOAuthAccessToken(host);
                     if (storedToken != null) {
                         return storedToken.getParameters();
                     }
                 } catch (CredentialsAgentException e) {
                     Logging.trace(e);
                 }
-                IOAuthParameters remembered = createFromPreferences(originalApiUrl, apiUrl);
-                if (remembered != null) {
-                    return remembered;
+                if (!isUseDefault(apiUrl)) {
+                    // the API URL is where earlier versions of JOSM stored them
+                    IOAuthParameters remembered = createFromPreferences(host, apiUrl);
+                    if (remembered != null) {
+                        return remembered;
+                    }
                 }
-                // Use the URL as it was given: apiUrl is the host by now, which is never a valid URL, so
-                // createDefault() would silently fall back to the API currently configured in the preferences.
-                return createDefault(originalApiUrl, oAuthVersion);
+                // Use the URL as it was given: the host is never a valid URL, so createDefault() would silently
+                // fall back to the API currently configured in the preferences.
+                return createDefault(apiUrl, oAuthVersion);
             default:
                 throw new IllegalArgumentException("Unknown OAuth version: " + oAuthVersion);
         }
diff --git src/org/openstreetmap/josm/data/oauth/OsmPrivileges.java src/org/openstreetmap/josm/data/oauth/OsmPrivileges.java
deleted file mode 100644
index 332f788cc8..0000000000
--- src/org/openstreetmap/josm/data/oauth/OsmPrivileges.java
+++ /dev/null
@@ -1,130 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.data.oauth;
-
-/**
- * List of permissions granted to the current OSM connection.
- * @since 2747
- */
-public class OsmPrivileges {
-    private boolean allowWriteApi;
-    private boolean allowWriteGpx;
-    private boolean allowReadGpx;
-    private boolean allowReadPrefs;
-    private boolean allowWritePrefs;
-    private boolean allowModifyNotes;
-    private boolean allowWriteDiary;
-
-    /**
-     * Determines if the client is allowed to modify the map.
-     * @return {@code true} if the client is allowed to modify the map, {@code false} otherwise
-     */
-    public boolean isAllowWriteApi() {
-        return allowWriteApi;
-    }
-
-    /**
-     * Sets whether the client is allowed to modify the map.
-     * @param allowWriteApi {@code true} if the client is allowed to modify the map, {@code false} otherwise
-     */
-    public void setAllowWriteApi(boolean allowWriteApi) {
-        this.allowWriteApi = allowWriteApi;
-    }
-
-    /**
-     * Determines if the client is allowed to upload GPS traces.
-     * @return {@code true} if the client is allowed to upload GPS traces, {@code false} otherwise
-     */
-    public boolean isAllowWriteGpx() {
-        return allowWriteGpx;
-    }
-
-    /**
-     * Sets whether the client is allowed to upload GPS traces.
-     * @param allowWriteGpx {@code true} if the client is allowed to upload GPS traces, {@code false} otherwise
-     */
-    public void setAllowWriteGpx(boolean allowWriteGpx) {
-        this.allowWriteGpx = allowWriteGpx;
-    }
-
-    /**
-     * Determines if the client is allowed to read private GPS traces.
-     * @return {@code true} if the client is allowed to read private GPS traces, {@code false} otherwise
-     */
-    public boolean isAllowReadGpx() {
-        return allowReadGpx;
-    }
-
-    /**
-     * Sets whether the client is allowed to read private GPS traces.
-     * @param allowReadGpx {@code true} if the client is allowed to read private GPS traces, {@code false} otherwise
-     */
-    public void setAllowReadGpx(boolean allowReadGpx) {
-        this.allowReadGpx = allowReadGpx;
-    }
-
-    /**
-     * Determines if the client is allowed to read user preferences.
-     * @return {@code true} if the client is allowed to read user preferences, {@code false} otherwise
-     */
-    public boolean isAllowReadPrefs() {
-        return allowReadPrefs;
-    }
-
-    /**
-     * Sets whether the client is allowed to read user preferences.
-     * @param allowReadPrefs {@code true} if the client is allowed to read user preferences, {@code false} otherwise
-     */
-    public void setAllowReadPrefs(boolean allowReadPrefs) {
-        this.allowReadPrefs = allowReadPrefs;
-    }
-
-    /**
-     * Determines if the client is allowed to modify user preferences.
-     * @return {@code true} if the client is allowed to modify user preferences, {@code false} otherwise
-     */
-    public boolean isAllowWritePrefs() {
-        return allowWritePrefs;
-    }
-
-    /**
-     * Sets whether the client is allowed to modify user preferences.
-     * @param allowWritePrefs {@code true} if the client is allowed to modify user preferences, {@code false} otherwise
-     */
-    public void setAllowWritePrefs(boolean allowWritePrefs) {
-        this.allowWritePrefs = allowWritePrefs;
-    }
-
-    /**
-     * Determines if the client is allowed to modify notes.
-     * @return {@code true} if the client is allowed to modify notes, {@code false} otherwise
-     */
-    public boolean isAllowModifyNotes() {
-        return allowModifyNotes;
-    }
-
-    /**
-     * Sets whether the client is allowed to modify notes.
-     * @param allowModifyNotes {@code true} if the client is allowed to modify notes, {@code false} otherwise
-     */
-    public void setAllowModifyNotes(boolean allowModifyNotes) {
-        this.allowModifyNotes = allowModifyNotes;
-    }
-
-    /**
-     * Determines if the client is allowed to write diary.
-     * @return {@code true} if the client is allowed to write diary, {@code false} otherwise
-     * @since 17972
-     */
-    public boolean isAllowWriteDiary() {
-        return allowWriteDiary;
-    }
-
-    /**
-     * Sets whether the client is allowed to write diary.
-     * @param allowWriteDiary {@code true} if the client is allowed to write diary, {@code false} otherwise
-     * @since 17972
-     */
-    public void setAllowWriteDiary(boolean allowWriteDiary) {
-        this.allowWriteDiary = allowWriteDiary;
-    }
-}
diff --git src/org/openstreetmap/josm/data/oauth/osm/OsmScopes.java src/org/openstreetmap/josm/data/oauth/osm/OsmScopes.java
index aacdf2e6fe..14dff14660 100644
--- src/org/openstreetmap/josm/data/oauth/osm/OsmScopes.java
+++ src/org/openstreetmap/josm/data/oauth/osm/OsmScopes.java
@@ -20,5 +20,15 @@ public enum OsmScopes {
     /** Upload GPS traces */
     write_gpx,
     /** Modify notes */
-    write_notes
+    write_notes;
+
+    /**
+     * Get the scopes JOSM requests when it is authorized. An OAuth 2.0 application which JOSM is to use must be
+     * registered with at least these.
+     * @return the scopes, in the order they are requested
+     * @since xxx
+     */
+    public static OsmScopes[] getJosmScopes() {
+        return new OsmScopes[] {read_gpx, write_gpx, read_prefs, write_prefs, write_api, write_notes};
+    }
 }
diff --git src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
index 2aec87957c..62b25af769 100644
--- src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
+++ src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
@@ -15,7 +15,10 @@ import java.util.regex.Pattern;
 
 import javax.swing.JOptionPane;
 
+import org.openstreetmap.josm.actions.PreferencesAction;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
+import org.openstreetmap.josm.gui.preferences.server.ServerAccessPreference;
 import org.openstreetmap.josm.io.ChangesetClosedException;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.MissingOAuthAccessTokenException;
@@ -25,6 +28,7 @@ import org.openstreetmap.josm.io.OsmApiException;
 import org.openstreetmap.josm.io.OsmApiInitializationException;
 import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.tools.ExceptionUtil;
+import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
@@ -368,11 +372,24 @@ public final class ExceptionDialogUtil {
      * @param e the exception
      */
     public static void explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e) {
-        showErrorDialog(
+        final ButtonSpec[] buttons = {
+                new ButtonSpec(tr("Open preferences"), new ImageProvider("preference"),
+                        tr("Open the OSM server preferences, to authorize JOSM or to enter an Access Token"), null),
+                new ButtonSpec(tr("Close"), new ImageProvider("cancel"), tr("Close this message"), null)
+        };
+        final int answer = HelpAwareOptionPane.showOptionDialog(
+                MainApplication.getMainFrame(),
                 ExceptionUtil.explainMissingOAuthAccessTokenException(e),
                 tr("Authentication failed"),
+                JOptionPane.ERROR_MESSAGE,
+                null,
+                buttons,
+                buttons[0],
                 ht("/ErrorMessages#MissingOAuthAccessToken")
         );
+        if (answer == 0) {
+            PreferencesAction.forPreferenceTab(tr("Preferences"), null, ServerAccessPreference.class).run();
+        }
     }
 
     /**
diff --git src/org/openstreetmap/josm/gui/MainApplication.java src/org/openstreetmap/josm/gui/MainApplication.java
index 9cdc48cc57..f2eecbf110 100644
--- src/org/openstreetmap/josm/gui/MainApplication.java
+++ src/org/openstreetmap/josm/gui/MainApplication.java
@@ -119,7 +119,6 @@ import org.openstreetmap.josm.gui.layer.MainLayerManager;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.mappaint.RenderingCLI;
 import org.openstreetmap.josm.gui.mappaint.loader.MapPaintStyleLoader;
-import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard;
 import org.openstreetmap.josm.gui.preferences.ToolbarPreferences;
 import org.openstreetmap.josm.gui.preferences.display.LafPreference;
 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
@@ -139,7 +138,6 @@ import org.openstreetmap.josm.io.FileWatcher;
 import org.openstreetmap.josm.io.MessageNotifier;
 import org.openstreetmap.josm.io.NetworkManager;
 import org.openstreetmap.josm.io.OnlineResource;
-import org.openstreetmap.josm.io.OsmConnection;
 import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.io.auth.AbstractCredentialsAgent;
 import org.openstreetmap.josm.io.auth.CredentialsManager;
@@ -1110,7 +1108,6 @@ public class MainApplication {
 
     static void setupCallbacks() {
         HttpClient.setFactory(Http1Client::new);
-        OsmConnection.setOAuthAccessTokenFetcher(OAuthAuthorizationWizard::obtainAccessToken);
         AbstractCredentialsAgent.setCredentialsProvider(CredentialDialog::promptCredentials);
         MessageNotifier.setNotifierCallback(MainApplication::notifyNewMessages);
         DeleteCommand.setDeletionCallback(DeleteAction.defaultDeletionCallback);
diff --git src/org/openstreetmap/josm/gui/oauth/AbstractAuthorizationUI.java src/org/openstreetmap/josm/gui/oauth/AbstractAuthorizationUI.java
deleted file mode 100644
index 24d3d2d3e1..0000000000
--- src/org/openstreetmap/josm/gui/oauth/AbstractAuthorizationUI.java
+++ /dev/null
@@ -1,148 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.oauth;
-
-import java.util.Objects;
-
-import org.openstreetmap.josm.data.oauth.IOAuthParameters;
-import org.openstreetmap.josm.data.oauth.IOAuthToken;
-import org.openstreetmap.josm.data.oauth.OAuthParameters;
-import org.openstreetmap.josm.data.oauth.OAuthVersion;
-import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
-import org.openstreetmap.josm.tools.CheckParameterUtil;
-
-/**
- * This is the abstract base class for the three authorisation UIs.
- *
- * @since 2746
- */
-public abstract class AbstractAuthorizationUI extends VerticallyScrollablePanel {
-    /**
-     * The property name for the Access Token property
-     */
-    public static final String ACCESS_TOKEN_PROP = AbstractAuthorizationUI.class.getName() + ".accessToken";
-
-    private String apiUrl;
-    private final AdvancedOAuthPropertiesPanel pnlAdvancedProperties;
-    private transient IOAuthToken accessToken;
-
-    /**
-     * Constructs a new {@code AbstractAuthorizationUI} for the given API URL.
-     * @param apiUrl The OSM API URL (may be null)
-     * @param oAuthVersion The oauth version to use
-     * @since 18991
-     */
-    protected AbstractAuthorizationUI(String apiUrl, OAuthVersion oAuthVersion) {
-        this.pnlAdvancedProperties = new AdvancedOAuthPropertiesPanel(oAuthVersion);
-        if (apiUrl != null) {
-            setApiUrl(apiUrl);
-        }
-    }
-
-    protected void fireAccessTokenChanged(IOAuthToken oldValue, IOAuthToken newValue) {
-        firePropertyChange(ACCESS_TOKEN_PROP, oldValue, newValue);
-    }
-
-    /**
-     * Replies the URL of the OSM API for which this UI is currently trying to retrieve an OAuth
-     * Access Token
-     *
-     * @return the API URL
-     */
-    public String getApiUrl() {
-        return apiUrl;
-    }
-
-    /**
-     * Sets the URL of the OSM API for which this UI is currently trying to retrieve an OAuth
-     * Access Token
-     *
-     * @param apiUrl the api URL
-     */
-    public void setApiUrl(String apiUrl) {
-        this.apiUrl = apiUrl;
-        this.pnlAdvancedProperties.setApiUrl(apiUrl);
-    }
-
-    /**
-     * Replies the panel for entering advanced OAuth parameters (see {@link OAuthParameters})
-     *
-     * @return the panel for entering advanced OAuth parameters
-     * @see #getOAuthParameters()
-     */
-    protected AdvancedOAuthPropertiesPanel getAdvancedPropertiesPanel() {
-        return pnlAdvancedProperties;
-    }
-
-    /**
-     * Replies the current set of advanced OAuth parameters in this UI
-     *
-     * @return the current set of advanced OAuth parameters in this UI
-     */
-    public IOAuthParameters getOAuthParameters() {
-        return pnlAdvancedProperties.getAdvancedParameters();
-    }
-
-    /**
-     * Replies the retrieved Access Token. null, if no Access Token was retrieved.
-     *
-     * @return the retrieved Access Token
-     */
-    public IOAuthToken getAccessToken() {
-        return accessToken;
-    }
-
-    /**
-     * Sets the current Access Token. This will fire a property change event for {@link #ACCESS_TOKEN_PROP}
-     * if the access token has changed
-     *
-     * @param accessToken the new access token. null, to clear the current access token
-     */
-    protected void setAccessToken(IOAuthToken accessToken) {
-        IOAuthToken oldValue = this.accessToken;
-        this.accessToken = accessToken;
-        if (oldValue == null ^ this.accessToken == null) {
-            fireAccessTokenChanged(oldValue, this.accessToken);
-        } else if (oldValue == null && this.accessToken == null) {
-            // no change - don't fire an event
-        } else if (!Objects.equals(oldValue, this.accessToken)) {
-            fireAccessTokenChanged(oldValue, this.accessToken);
-        }
-    }
-
-    /**
-     * Get the OAuth version for this AuthorizationUI
-     * @return The OAuth version
-     * @since 18991
-     */
-    public OAuthVersion getOAuthVersion() {
-        return this.pnlAdvancedProperties.getAdvancedParameters().getOAuthVersion();
-    }
-
-    /**
-     * Replies true if this UI currently has an Access Token
-     *
-     * @return true if this UI currently has an Access Token
-     */
-    public boolean hasAccessToken() {
-        return accessToken != null;
-    }
-
-    /**
-     * Replies whether the user has chosen to save the Access Token in the JOSM
-     * preferences or not.
-     *
-     * @return true if the user has chosen to save the Access Token
-     */
-    public abstract boolean isSaveAccessTokenToPreferences();
-
-    /**
-     * Initializes the authorisation UI.
-     *
-     * @param paramApiUrl the API URL. Must not be null.
-     * @throws IllegalArgumentException if paramApiUrl is null
-     */
-    public void initialize(String paramApiUrl) {
-        CheckParameterUtil.ensureParameterNotNull(paramApiUrl, "paramApiUrl");
-        pnlAdvancedProperties.initialize(paramApiUrl);
-    }
-}
diff --git src/org/openstreetmap/josm/gui/oauth/AccessTokenInfoPanel.java src/org/openstreetmap/josm/gui/oauth/AccessTokenInfoPanel.java
deleted file mode 100644
index bc4098dfbc..0000000000
--- src/org/openstreetmap/josm/gui/oauth/AccessTokenInfoPanel.java
+++ /dev/null
@@ -1,105 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.oauth;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-
-import javax.swing.JCheckBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-import org.openstreetmap.josm.data.oauth.IOAuthToken;
-import org.openstreetmap.josm.data.oauth.OAuth20Token;
-import org.openstreetmap.josm.data.oauth.OAuthAccessTokenHolder;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
-import org.openstreetmap.josm.tools.JosmRuntimeException;
-
-/**
- * Displays the key of an OAuth Access Token.
- * @since 2746 (modified for OAuth 2 in 18991)
- */
-public class AccessTokenInfoPanel extends JPanel {
-
-    private final JosmTextField tfAccessTokenKey = new JosmTextField(null, null, 0, false);
-    private final JCheckBox cbSaveAccessTokenInPreferences = new JCheckBox(tr("Save Access Token in preferences"));
-
-    /**
-     * Constructs a new {@code AccessTokenInfoPanel}.
-     */
-    public AccessTokenInfoPanel() {
-        build();
-    }
-
-    protected final void build() {
-        setLayout(new GridBagLayout());
-        GridBagConstraints gc = new GridBagConstraints();
-
-        // the access token key
-        gc.anchor = GridBagConstraints.NORTHWEST;
-        gc.fill = GridBagConstraints.HORIZONTAL;
-        gc.weightx = 0.0;
-        gc.insets = new Insets(0, 0, 3, 3);
-        add(new JLabel(tr("Access Token Key:")), gc);
-
-        gc.gridx = 1;
-        gc.weightx = 1.0;
-        add(tfAccessTokenKey, gc);
-        tfAccessTokenKey.setEditable(false);
-
-        // the access token secret
-        gc.gridx = 0;
-        gc.gridy = 1;
-        gc.weightx = 0.0;
-        gc.insets = new Insets(0, 0, 3, 3);
-        add(new JLabel(tr("Access Token Secret:")), gc);
-
-        gc.weightx = 1.0;
-        // the checkbox
-        gc.gridx = 0;
-        gc.gridy = 2;
-        gc.gridwidth = 2;
-        add(cbSaveAccessTokenInPreferences, gc);
-        cbSaveAccessTokenInPreferences.setToolTipText(tr(
-                "<html>Select to save the Access Token in the JOSM preferences.<br>"
-                + "Unselect to use the Access Token in this JOSM session only.</html>"
-        ));
-        cbSaveAccessTokenInPreferences.setSelected(OAuthAccessTokenHolder.getInstance().isSaveToPreferences());
-
-        // filler - grab the remaining space
-        gc.gridx = 0;
-        gc.gridy = 3;
-        gc.weightx = 1.0;
-        gc.weighty = 1.0;
-        gc.fill = GridBagConstraints.BOTH;
-        gc.gridwidth = 2;
-        add(new JPanel(), gc);
-    }
-
-    /**
-     * Displays the key and secret in <code>token</code>.
-     *
-     * @param token the access  token. If null, the content in the info panel is cleared
-     */
-    public void setAccessToken(IOAuthToken token) {
-        if (token == null) {
-            tfAccessTokenKey.setText("");
-            return;
-        }
-        if (token instanceof OAuth20Token) {
-            tfAccessTokenKey.setText(((OAuth20Token) token).getBearerToken());
-        } else {
-            throw new JosmRuntimeException("Unknown token type: " + token.getClass());
-        }
-    }
-
-    public void setSaveToPreferences(boolean saveToPreferences) {
-        cbSaveAccessTokenInPreferences.setSelected(saveToPreferences);
-    }
-
-    public boolean isSaveToPreferences() {
-        return cbSaveAccessTokenInPreferences.isSelected();
-    }
-}
diff --git src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java
index 063cc62c0d..7bccca48e4 100644
--- src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java
+++ src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java
@@ -9,9 +9,13 @@ import java.awt.GridBagLayout;
 import java.awt.Insets;
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import javax.swing.BorderFactory;
 import javax.swing.JCheckBox;
+import javax.swing.JComponent;
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
 import javax.swing.event.DocumentEvent;
@@ -21,6 +25,7 @@ import org.openstreetmap.josm.data.oauth.IOAuthParameters;
 import org.openstreetmap.josm.data.oauth.OAuth20Parameters;
 import org.openstreetmap.josm.data.oauth.OAuthParameters;
 import org.openstreetmap.josm.data.oauth.OAuthVersion;
+import org.openstreetmap.josm.data.oauth.osm.OsmScopes;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -29,20 +34,18 @@ import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
-import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.ImageProvider;
 
 /**
  * Panel allowing the user to setup advanced OAuth parameters:
  * <ul>
- * <li>Consumer key</li>
- * <li>Consumer secret</li>
- * <li>Request token URL</li>
+ * <li>Client ID</li>
+ * <li>Client secret</li>
+ * <li>Redirect URI</li>
  * <li>Access token URL</li>
  * <li>Authorize URL</li>
- * <li>OSM login URL</li>
- * <li>OSM logout URL</li>
+ * <li>Access token, which can be pasted instead of authorizing JOSM</li>
  * </ul>
  *
  * @see OAuthParameters
@@ -57,11 +60,13 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
     public static final String PARAMETERS_CHANGED_PROP = AdvancedOAuthPropertiesPanel.class.getName() + ".parametersChanged";
 
     private final JCheckBox cbUseDefaults = new JCheckBox(tr("Use default settings"));
-    private final JosmTextField tfConsumerKey = new JosmTextField();
-    private final JosmTextField tfConsumerSecret = new JosmTextField();
-    private final JosmTextField tfRequestTokenURL = new JosmTextField();
+    private final JosmTextField tfClientId = new JosmTextField();
+    private final JosmTextField tfClientSecret = new JosmTextField();
+    private final JosmTextField tfRedirectUri = new JosmTextField();
     private final JosmTextField tfAccessTokenURL = new JosmTextField();
     private final JosmTextField tfAuthoriseURL = new JosmTextField();
+    private final JLabel lblAccessToken = new JLabel(tr("Access Token:"));
+    private final JosmTextField tfAccessToken = new JosmTextField();
     private final OAuthVersion oauthVersion;
     private transient UseDefaultItemListener ilUseDefault;
     private String apiUrl;
@@ -87,44 +92,44 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
         gc.gridwidth = 3;
         add(cbUseDefaults, gc);
 
-        // -- consumer key
+        // -- client id
         gc.gridy = 1;
         gc.weightx = 0.0;
         gc.gridwidth = 1;
-        add(new JLabel(tr("Client ID:")), gc);
+        add(label(tr("Client ID:"), tfClientId), gc);
 
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfConsumerKey, gc);
-        SelectAllOnFocusGainedDecorator.decorate(tfConsumerKey);
+        add(tfClientId, gc);
+        SelectAllOnFocusGainedDecorator.decorate(tfClientId);
 
-        // -- consumer secret
+        // -- client secret
         gc.gridy++;
         gc.gridx = 0;
         gc.weightx = 0.0;
-        add(new JLabel(tr("Client Secret:")), gc);
+        add(label(tr("Client Secret:"), tfClientSecret), gc);
 
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfConsumerSecret, gc);
-        SelectAllOnFocusGainedDecorator.decorate(tfConsumerSecret);
+        add(tfClientSecret, gc);
+        SelectAllOnFocusGainedDecorator.decorate(tfClientSecret);
 
-        // -- request token URL
+        // -- redirect URI
         gc.gridy++;
         gc.gridx = 0;
         gc.weightx = 0.0;
-        add(new JLabel(tr("Redirect URL:")), gc);
+        add(label(tr("Redirect URL:"), tfRedirectUri), gc);
 
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfRequestTokenURL, gc);
-        SelectAllOnFocusGainedDecorator.decorate(tfRequestTokenURL);
+        add(tfRedirectUri, gc);
+        SelectAllOnFocusGainedDecorator.decorate(tfRedirectUri);
 
         // -- access token URL
         gc.gridy++;
         gc.gridx = 0;
         gc.weightx = 0.0;
-        add(new JLabel(tr("Access Token URL:")), gc);
+        add(label(tr("Access Token URL:"), tfAccessTokenURL), gc);
 
         gc.gridx = 1;
         gc.weightx = 1.0;
@@ -135,18 +140,33 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
         gc.gridy++;
         gc.gridx = 0;
         gc.weightx = 0.0;
-        add(new JLabel(tr("Authorize URL:")), gc);
+        add(label(tr("Authorize URL:"), tfAuthoriseURL), gc);
 
         gc.gridx = 1;
         gc.weightx = 1.0;
         add(tfAuthoriseURL, gc);
         SelectAllOnFocusGainedDecorator.decorate(tfAuthoriseURL);
 
+        // -- access token: not one of the settings, so it can be pasted whether or not they are the default ones
+        gc.gridy++;
+        gc.gridx = 0;
+        gc.weightx = 0.0;
+        lblAccessToken.setLabelFor(tfAccessToken);
+        add(lblAccessToken, gc);
+
+        gc.gridx = 1;
+        gc.weightx = 1.0;
+        add(tfAccessToken, gc);
+        SelectAllOnFocusGainedDecorator.decorate(tfAccessToken);
+
+        setToolTips();
+
         ilUseDefault = new UseDefaultItemListener();
         cbUseDefaults.addItemListener(ilUseDefault);
-        cbUseDefaults.setSelected(Config.getPref().getBoolean("oauth.settings.use-default", true));
+        cbUseDefaults.setSelected(true);
+        setChildComponentsVisible(false);
         cbUseDefaults.addItemListener(e -> fireParametersChanged());
-        tfConsumerKey.getDocument().addDocumentListener(new DocumentListener() {
+        tfClientId.getDocument().addDocumentListener(new DocumentListener() {
             @Override
             public void insertUpdate(DocumentEvent e) {
                 fireParametersChanged();
@@ -164,10 +184,70 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
         });
     }
 
+    /**
+     * Creates the label of a field, which has the tool tip of the field.
+     * @param text the text of the label
+     * @param field the field
+     * @return the label
+     */
+    private static JLabel label(String text, JosmTextField field) {
+        final JLabel label = new JLabel(text);
+        label.setLabelFor(field);
+        return label;
+    }
+
+    /**
+     * Explains each field, for the fields and their labels.
+     */
+    private void setToolTips() {
+        final String scopes = Stream.of(OsmScopes.getJosmScopes()).map(Enum::name).collect(Collectors.joining(", "));
+        cbUseDefaults.setToolTipText(tr("<html>Use the OAuth settings JOSM has built in for this server, or which the server publishes.<br>"
+                + "Untick to enter the settings of an OAuth 2.0 application you registered on the server yourself.</html>"));
+        tfClientId.setToolTipText(tr("<html>The Client ID of an OAuth 2.0 application registered on this server.<br>"
+                + "On an openstreetmap-website server, register one under My Settings &gt; OAuth 2 applications,<br>"
+                + "with the redirect URL below and the permissions {0}.</html>", scopes));
+        tfClientSecret.setToolTipText(tr("<html>Only needed if the application is registered as confidential.<br>"
+                + "The applications JOSM has built in are public clients and have none.</html>"));
+        tfRedirectUri.setToolTipText(tr("<html>Must be exactly the redirect URL registered with the application.<br>"
+                + "JOSM receives the authorization at {0}, by remote control.</html>", "http://127.0.0.1:8111/oauth_authorization"));
+        tfAccessTokenURL.setToolTipText(tr("<html>Where JOSM gets the Access Token from.<br>"
+                + "Taken from the OAuth metadata of the server if it publishes any; on an openstreetmap-website server,<br>"
+                + "this is the address of the website followed by {0}, not the API URL.</html>", "/oauth2/token"));
+        tfAuthoriseURL.setToolTipText(tr("<html>Where the web browser is sent to authorize JOSM.<br>"
+                + "Taken from the OAuth metadata of the server if it publishes any; on an openstreetmap-website server,<br>"
+                + "this is the address of the website followed by {0}, not the API URL.</html>", "/oauth2/authorize"));
+        tfAccessToken.setToolTipText(tr("<html>The Access Token JOSM uses for this server.<br>"
+                + "A token issued outside JOSM can be pasted here instead of authorizing JOSM; it needs the permissions {0}.</html>",
+                scopes));
+        for (Component c : getComponents()) {
+            if (c instanceof JLabel && ((JLabel) c).getLabelFor() instanceof JComponent) {
+                ((JLabel) c).setToolTipText(((JComponent) ((JLabel) c).getLabelFor()).getToolTipText());
+            }
+        }
+    }
+
     private void fireParametersChanged() {
         firePropertyChange(PARAMETERS_CHANGED_PROP, null, null);
     }
 
+    /**
+     * Get the access token as entered in the panel.
+     * @return the access token, without surrounding white space; empty if there is none
+     * @since xxx
+     */
+    public String getAccessToken() {
+        return tfAccessToken.getText().trim();
+    }
+
+    /**
+     * Sets the access token to be displayed.
+     * @param accessToken the access token, or {@code null} if there is none
+     * @since xxx
+     */
+    public void setAccessToken(String accessToken) {
+        tfAccessToken.setText(accessToken);
+    }
+
     /**
      * Determines if the panel is set to use the default parameters for the API URL rather than
      * the values entered in its fields.
@@ -180,15 +260,15 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
 
     /**
      * Get the client id as entered in the panel, without falling back to the defaults.
-     * @return the client id field's text
+     * @return the client id field's text, without surrounding white space
      * @since 19627
      */
     public String getEnteredClientId() {
-        return tfConsumerKey.getText();
+        return tfClientId.getText().trim();
     }
 
     protected boolean hasCustomSettings() {
-        IOAuthParameters params = OAuthParameters.createDefault(apiUrl, OAuthVersion.OAuth20);
+        IOAuthParameters params = OAuthParameters.createDefault(apiUrl, this.oauthVersion);
         return !params.equals(getAdvancedParameters());
     }
 
@@ -230,25 +310,35 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
                         case OAuth20:
                         case OAuth21:
                             OAuth20Parameters params20 = (OAuth20Parameters) iParams;
-                            tfConsumerKey.setText(params20.getClientId());
-                            tfConsumerSecret.setText(params20.getClientSecret());
+                            tfClientId.setText(params20.getClientId());
+                            tfClientSecret.setText(params20.getClientSecret());
                             tfAccessTokenURL.setText(params20.getAccessTokenUrl());
                             tfAuthoriseURL.setText(params20.getAuthorizationUrl());
-                            tfRequestTokenURL.setText(params20.getRedirectUri());
+                            tfRedirectUri.setText(params20.getRedirectUri());
                             break;
                         default:
                             throw new UnsupportedOperationException("Unsupported OAuth version: " + this.oauthVersion);
                     }
-                    setChildComponentsEnabled(false);
+                    setChildComponentsVisible(false);
                 });
     }
 
-    protected void setChildComponentsEnabled(boolean enabled) {
+    /**
+     * Shows or hides the OAuth parameters: they are shown when the user enters them, that is when the default
+     * settings are not used. The access token is not one of them, and is always shown.
+     * @param visible {@code true} to show the parameters
+     * @since xxx
+     */
+    protected void setChildComponentsVisible(boolean visible) {
         for (Component c: getComponents()) {
+            if (c == tfAccessToken || c == lblAccessToken) {
+                continue;
+            }
             if (c instanceof JosmTextField || c instanceof JLabel) {
-                c.setEnabled(enabled);
+                c.setVisible(visible);
             }
         }
+        revalidate();
     }
 
     /**
@@ -259,13 +349,26 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
     public IOAuthParameters getAdvancedParameters() {
         if (cbUseDefaults.isSelected())
             return OAuthParameters.createDefault(apiUrl, this.oauthVersion);
+        return getDisplayedParameters();
+    }
+
+    /**
+     * Replies the OAuth parameters as currently displayed in this properties panel: the default ones are shown when
+     * "use default settings" is ticked, as far as they are known yet. Unlike {@link #getAdvancedParameters()}, this
+     * never makes a network request, and some of the parameters may be empty. White space around the values, which
+     * is easily copied along with them, is left out: a client secret with a trailing space is refused by the server.
+     *
+     * @return the OAuth parameters
+     * @since xxx
+     */
+    public OAuth20Parameters getDisplayedParameters() {
         return new OAuth20Parameters(
-                tfConsumerKey.getText(),
-                tfConsumerSecret.getText(),
-                tfAccessTokenURL.getText(),
-                tfAuthoriseURL.getText(),
+                tfClientId.getText().trim(),
+                tfClientSecret.getText().trim(),
+                tfAccessTokenURL.getText().trim(),
+                tfAuthoriseURL.getText().trim(),
                 apiUrl,
-                tfRequestTokenURL.getText()
+                tfRedirectUri.getText().trim()
                 );
     }
 
@@ -279,17 +382,17 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
         CheckParameterUtil.ensureParameterNotNull(parameters, "parameters");
         if (parameters.equals(OAuthParameters.createDefault(apiUrl, parameters.getOAuthVersion()))) {
             cbUseDefaults.setSelected(true);
-            setChildComponentsEnabled(false);
+            setChildComponentsVisible(false);
         } else {
             cbUseDefaults.setSelected(false);
-            setChildComponentsEnabled(true);
+            setChildComponentsVisible(true);
             if (parameters instanceof OAuth20Parameters) {
                 OAuth20Parameters parameters20 = (OAuth20Parameters) parameters;
-                tfConsumerKey.setText(parameters20.getClientId());
-                tfConsumerSecret.setText(parameters20.getClientSecret());
+                tfClientId.setText(parameters20.getClientId());
+                tfClientSecret.setText(parameters20.getClientSecret());
                 tfAccessTokenURL.setText(parameters20.getAccessTokenUrl());
                 tfAuthoriseURL.setText(parameters20.getAuthorizationUrl());
-                tfRequestTokenURL.setText(parameters20.getRedirectUri());
+                tfRedirectUri.setText(parameters20.getRedirectUri());
             }
         }
     }
@@ -302,15 +405,18 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
      */
     public void initialize(String paramApiUrl) {
         CheckParameterUtil.ensureParameterNotNull(paramApiUrl, "paramApiUrl");
-        setApiUrl(paramApiUrl);
-        boolean useDefault = Config.getPref().getBoolean("oauth.settings.use-default", true);
+        this.apiUrl = paramApiUrl;
+        // "use default settings" is a setting of each server
+        boolean useDefault = OAuthParameters.isUseDefault(paramApiUrl);
         ilUseDefault.setEnabled(false);
+        cbUseDefaults.setSelected(useDefault);
+        setChildComponentsVisible(!useDefault);
         MainApplication.worker.execute(() -> {
             if (useDefault) {
                 this.resetToDefaultSettings();
             } else {
                 // createFromApiUrl may make a network request
-                final IOAuthParameters parameters = OAuthParameters.createFromApiUrl(paramApiUrl, OAuthVersion.OAuth20);
+                final IOAuthParameters parameters = OAuthParameters.createFromApiUrl(paramApiUrl, this.oauthVersion);
                 GuiHelper.runInEDT(() -> setAdvancedParameters(parameters));
             }
             GuiHelper.runInEDT(() -> ilUseDefault.setEnabled(true));
@@ -318,13 +424,16 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
     }
 
     /**
-     * Remembers the current values in the preferences <code>pref</code>.
+     * Remembers the current values in the preferences <code>pref</code>: whether the server uses the default
+     * settings, and the settings entered if not. Settings entered earlier are kept when the default settings are
+     * used, so that they are there again when they are needed again.
      */
     public void rememberPreferences() {
-        Config.getPref().putBoolean("oauth.settings.use-default", cbUseDefaults.isSelected());
-        if (cbUseDefaults.isSelected()) {
-            MainApplication.worker.execute(() -> OAuthParameters.createDefault().rememberPreferences());
-        } else {
+        if (apiUrl == null) {
+            return; // not initialized
+        }
+        OAuthParameters.setUseDefault(apiUrl, cbUseDefaults.isSelected());
+        if (!cbUseDefaults.isSelected()) {
             getAdvancedParameters().rememberPreferences();
         }
     }
@@ -344,7 +453,7 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
                 MainApplication.worker.execute(AdvancedOAuthPropertiesPanel.this::resetToDefaultSettings);
                 break;
             case ItemEvent.DESELECTED:
-                setChildComponentsEnabled(true);
+                setChildComponentsVisible(true);
                 break;
             default: // Do nothing
             }
@@ -362,6 +471,12 @@ public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel {
      * @since 5422
      */
     public void setApiUrl(String apiUrl) {
+        if (this.apiUrl != null && apiUrl != null
+                && !Objects.equals(OAuthParameters.getHost(this.apiUrl), OAuthParameters.getHost(apiUrl))) {
+            // another server, with settings of its own
+            initialize(apiUrl);
+            return;
+        }
         this.apiUrl = apiUrl;
         if (cbUseDefaults.isSelected()) {
             MainApplication.worker.execute(this::resetToDefaultSettings);
diff --git src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedure.java src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedure.java
deleted file mode 100644
index a8fa2a4afa..0000000000
--- src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedure.java
+++ /dev/null
@@ -1,76 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.oauth;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-/**
- * The type of procedure to use for retrieving OAuth credentials.
- */
-public enum AuthorizationProcedure {
-    /**
-     * Run a fully automatic procedure to get an access token from the OSM website.
-     * JOSM accesses the OSM website on behalf of the JOSM user and interacts
-     * with the site using an OSM session, form posting and screen scraping.
-     */
-    FULLY_AUTOMATIC,
-
-    /**
-     * Run a semi-automatic procedure to get an access token from the OSM website.
-     * JOSM submits the standards OAuth requests to get a Request Token and an
-     * Access Token. It dispatches the user to the OSM website in an external browser
-     * to authenticate itself and to accept the request token submitted by JOSM.
-     */
-    SEMI_AUTOMATIC,
-
-    /**
-     * Enter an Access Token manually. The Access Token could have been generated
-     * by another JOSM user and sent to the current JOSM user via email, i.e. in order
-     * to grant the current OSM user the right download its private GPS traces. Or it could
-     * have been generated in a former session and filed away in a secure place.
-     */
-    MANUALLY;
-
-    /**
-     * Returns the translated name of this procedure
-     * @return the translated name of this procedure
-     */
-    public String getText() {
-        switch (this) {
-        case FULLY_AUTOMATIC:
-            return tr("Fully automatic");
-        case SEMI_AUTOMATIC:
-            return tr("Semi-automatic");
-        case MANUALLY:
-            return tr("Manual");
-        }
-        throw new IllegalStateException();
-    }
-
-    /**
-     * Returns a translated description of this procedure
-     * @return a translated description of this procedure
-     */
-    public String getDescription() {
-        switch (this) {
-        case FULLY_AUTOMATIC:
-            return tr(
-                    "<html>Run a fully automatic procedure to get an access token from the OSM website.<br>"
-                    + "JOSM accesses the OSM website on behalf of the JOSM user and fully<br>"
-                    + "automatically authorizes the user and retrieves an Access Token.</html>"
-            );
-        case SEMI_AUTOMATIC:
-            return tr(
-                    "<html>Run a semi-automatic procedure to get an access token from the OSM website.<br>"
-                    + "JOSM submits the standards OAuth requests to get a Request Token and an<br>"
-                    + "Access Token. It dispatches the user to the OSM website in an external browser<br>"
-                    + "to authenticate itself and to accept the request token submitted by JOSM.</html>"
-            );
-        case MANUALLY:
-            return tr(
-                    "<html>Enter an Access Token manually if it was generated and retrieved outside<br>"
-                    + "of JOSM.</html>"
-            );
-        }
-        throw new IllegalStateException();
-    }
-}
diff --git src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java
deleted file mode 100644
index 310019e450..0000000000
--- src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java
+++ /dev/null
@@ -1,375 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.oauth;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.io.IOException;
-import java.util.concurrent.Executor;
-
-import javax.swing.AbstractAction;
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTabbedPane;
-import javax.swing.text.html.HTMLEditorKit;
-
-import org.openstreetmap.josm.data.oauth.IOAuthToken;
-import org.openstreetmap.josm.data.oauth.OAuthVersion;
-import org.openstreetmap.josm.gui.HelpAwareOptionPane;
-import org.openstreetmap.josm.gui.PleaseWaitRunnable;
-import org.openstreetmap.josm.gui.help.HelpUtil;
-import org.openstreetmap.josm.gui.util.GuiHelper;
-import org.openstreetmap.josm.gui.widgets.HtmlPanel;
-import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
-import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
-import org.openstreetmap.josm.io.OsmTransferException;
-import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.tools.Logging;
-import org.xml.sax.SAXException;
-
-/**
- * This is a UI which supports a JOSM user to get an OAuth Access Token in a fully
- * automatic process.
- *
- * @since 2746
- */
-public class FullyAutomaticAuthorizationUI extends AbstractAuthorizationUI {
-    private final AccessTokenInfoPanel pnlAccessTokenInfo = new AccessTokenInfoPanel();
-    private OsmPrivilegesPanel pnlOsmPrivileges;
-    private JPanel pnlPropertiesPanel;
-    private JPanel pnlActionButtonsPanel;
-    private JPanel pnlResult;
-    private final transient Executor executor;
-
-    /**
-     * Builds the panel with the three privileges the user can grant JOSM
-     *
-     * @return constructed panel for the privileges
-     */
-    protected VerticallyScrollablePanel buildGrantsPanel() {
-        pnlOsmPrivileges = new OsmPrivilegesPanel();
-        return pnlOsmPrivileges;
-    }
-
-    /**
-     * Builds the panel for entering the username and password
-     *
-     * @return constructed panel for the credentials
-     */
-    protected VerticallyScrollablePanel buildUserNamePasswordPanel() {
-        VerticallyScrollablePanel pnl = new VerticallyScrollablePanel(new GridBagLayout());
-        GridBagConstraints gc = new GridBagConstraints();
-        pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
-
-        gc.anchor = GridBagConstraints.NORTHWEST;
-        gc.fill = GridBagConstraints.HORIZONTAL;
-        gc.weightx = 1.0;
-        gc.gridwidth = 2;
-        HtmlPanel pnlMessage = new HtmlPanel();
-        HTMLEditorKit kit = (HTMLEditorKit) pnlMessage.getEditorPane().getEditorKit();
-        kit.getStyleSheet().addRule(
-                ".warning-body {background-color:#DDFFDD; padding: 10pt; " +
-                "border-color:rgb(128,128,128);border-style: solid;border-width: 1px;}");
-        kit.getStyleSheet().addRule("ol {margin-left: 1cm}");
-        pnlMessage.setText("<html><body><p class=\"warning-body\">"
-                + tr("Please enter your OSM user name and password. The password will <strong>not</strong> be saved "
-                        + "in clear text in the JOSM preferences and it will be submitted to the OSM server <strong>only once</strong>. "
-                        + "Subsequent data upload requests don''t use your password any more.").replace(". ", ".<br>")
-                        + "</p>"
-                        + "</body></html>");
-        pnl.add(pnlMessage, gc);
-
-        // the user name input field
-        gc.gridy = 1;
-        gc.gridwidth = 1;
-        gc.anchor = GridBagConstraints.NORTHWEST;
-        gc.fill = GridBagConstraints.HORIZONTAL;
-        gc.weightx = 0.0;
-        gc.insets = new Insets(0, 0, 3, 3);
-        pnl.add(new JLabel(tr("Username: ")), gc);
-
-        // the password input field
-        gc.anchor = GridBagConstraints.NORTHWEST;
-        gc.fill = GridBagConstraints.HORIZONTAL;
-        gc.gridy = 2;
-        gc.gridx = 0;
-        gc.weightx = 0.0;
-        pnl.add(new JLabel(tr("Password:")), gc);
-
-        // filler - grab remaining space
-        gc.gridx = 1;
-        gc.gridy = 4;
-        gc.gridwidth = 2;
-        gc.fill = GridBagConstraints.BOTH;
-        gc.weightx = 1.0;
-        gc.weighty = 1.0;
-        pnl.add(new JPanel(), gc);
-
-        return pnl;
-    }
-
-    protected JPanel buildPropertiesPanel() {
-        JPanel pnl = new JPanel(new BorderLayout());
-
-        JTabbedPane tpProperties = new JTabbedPane();
-        tpProperties.add(buildUserNamePasswordPanel().getVerticalScrollPane());
-        tpProperties.add(buildGrantsPanel().getVerticalScrollPane());
-        tpProperties.add(getAdvancedPropertiesPanel().getVerticalScrollPane());
-        tpProperties.setTitleAt(0, tr("Basic"));
-        tpProperties.setTitleAt(1, tr("Granted rights"));
-        tpProperties.setTitleAt(2, tr("Advanced OAuth properties"));
-
-        pnl.add(tpProperties, BorderLayout.CENTER);
-        return pnl;
-    }
-
-    /**
-     * Builds the panel with the action button  for starting the authorisation
-     *
-     * @return constructed button panel
-     */
-    protected JPanel buildActionButtonPanel() {
-        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
-
-        RunAuthorisationAction runAuthorisationAction = new RunAuthorisationAction();
-        pnl.add(new JButton(runAuthorisationAction));
-        return pnl;
-    }
-
-    /**
-     * Builds the panel which displays the generated Access Token.
-     *
-     * @return constructed panel for the results
-     */
-    protected JPanel buildResultsPanel() {
-        JPanel pnl = new JPanel(new GridBagLayout());
-        GridBagConstraints gc = new GridBagConstraints();
-        pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
-
-        // the message panel
-        gc.anchor = GridBagConstraints.NORTHWEST;
-        gc.fill = GridBagConstraints.HORIZONTAL;
-        gc.weightx = 1.0;
-        JMultilineLabel msg = new JMultilineLabel("");
-        msg.setFont(msg.getFont().deriveFont(Font.PLAIN));
-        String lbl = tr("Accept Access Token");
-        msg.setText(tr("<html>"
-                + "You have successfully retrieved an OAuth Access Token from the OSM website. "
-                + "Click on <strong>{0}</strong> to accept the token. JOSM will use it in "
-                + "subsequent requests to gain access to the OSM API."
-                + "</html>", lbl));
-        pnl.add(msg, gc);
-
-        // infos about the access token
-        gc.gridy = 1;
-        gc.insets = new Insets(5, 0, 0, 0);
-        pnl.add(pnlAccessTokenInfo, gc);
-
-        // the actions
-        JPanel pnl1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
-        pnl1.add(new JButton(new BackAction()));
-        pnl1.add(new JButton(new TestAccessTokenAction()));
-        gc.gridy = 2;
-        pnl.add(pnl1, gc);
-
-        // filler - grab the remaining space
-        gc.gridy = 3;
-        gc.fill = GridBagConstraints.BOTH;
-        gc.weightx = 1.0;
-        gc.weighty = 1.0;
-        pnl.add(new JPanel(), gc);
-
-        return pnl;
-    }
-
-    protected final void build() {
-        setLayout(new BorderLayout());
-        pnlPropertiesPanel = buildPropertiesPanel();
-        pnlActionButtonsPanel = buildActionButtonPanel();
-        pnlResult = buildResultsPanel();
-
-        prepareUIForEnteringRequest();
-    }
-
-    /**
-     * Prepares the UI for the first step in the automatic process: entering the authentication
-     * and authorisation parameters.
-     *
-     */
-    protected void prepareUIForEnteringRequest() {
-        removeAll();
-        add(pnlPropertiesPanel, BorderLayout.CENTER);
-        add(pnlActionButtonsPanel, BorderLayout.SOUTH);
-        pnlPropertiesPanel.revalidate();
-        pnlActionButtonsPanel.revalidate();
-        validate();
-        repaint();
-
-        setAccessToken(null);
-    }
-
-    /**
-     * Prepares the UI for the second step in the automatic process: displaying the access token
-     *
-     */
-    protected void prepareUIForResultDisplay() {
-        removeAll();
-        add(pnlResult, BorderLayout.CENTER);
-        validate();
-        repaint();
-    }
-
-    /**
-     * Constructs a new {@code FullyAutomaticAuthorizationUI} for the given API URL.
-     * @param apiUrl The OSM API URL
-     * @param executor the executor used for running the HTTP requests for the authorization
-     * @param oAuthVersion The OAuth version to use for this UI
-     * @since 18991
-     */
-    public FullyAutomaticAuthorizationUI(String apiUrl, Executor executor, OAuthVersion oAuthVersion) {
-        super(apiUrl, oAuthVersion);
-        this.executor = executor;
-        build();
-    }
-
-    @Override
-    public boolean isSaveAccessTokenToPreferences() {
-        return pnlAccessTokenInfo.isSaveToPreferences();
-    }
-
-    @Override
-    protected void setAccessToken(IOAuthToken accessToken) {
-        super.setAccessToken(accessToken);
-        pnlAccessTokenInfo.setAccessToken(accessToken);
-    }
-
-    /**
-     * Starts the authorisation process
-     */
-    class RunAuthorisationAction extends AbstractAction {
-        RunAuthorisationAction() {
-            putValue(NAME, tr("Authorize now"));
-            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
-            putValue(SHORT_DESCRIPTION, tr("Click to redirect you to the authorization form on the JOSM web site"));
-        }
-
-        @Override
-        public void actionPerformed(ActionEvent evt) {
-            executor.execute(new FullyAutomaticAuthorisationTask(FullyAutomaticAuthorizationUI.this));
-        }
-    }
-
-    /**
-     * Action to go back to step 1 in the process
-     */
-    class BackAction extends AbstractAction {
-        BackAction() {
-            putValue(NAME, tr("Back"));
-            putValue(SHORT_DESCRIPTION, tr("Run the automatic authorization steps again"));
-            new ImageProvider("dialogs", "previous").getResource().attachImageIcon(this);
-        }
-
-        @Override
-        public void actionPerformed(ActionEvent arg0) {
-            prepareUIForEnteringRequest();
-        }
-    }
-
-    /**
-     * Action to test an access token.
-     */
-    class TestAccessTokenAction extends AbstractAction {
-        TestAccessTokenAction() {
-            putValue(NAME, tr("Test Access Token"));
-            new ImageProvider("logo").getResource().attachImageIcon(this);
-        }
-
-        @Override
-        public void actionPerformed(ActionEvent arg0) {
-            executor.execute(new TestAccessTokenTask(
-                    FullyAutomaticAuthorizationUI.this,
-                    getApiUrl(),
-                    getAccessToken()
-            ));
-        }
-    }
-
-    class FullyAutomaticAuthorisationTask extends PleaseWaitRunnable {
-        private boolean canceled;
-
-        FullyAutomaticAuthorisationTask(Component parent) {
-            super(parent, tr("Authorize JOSM to access the OSM API"), false /* don't ignore exceptions */);
-        }
-
-        @Override
-        protected void cancel() {
-            canceled = true;
-        }
-
-        @Override
-        protected void finish() {
-            // Do nothing
-        }
-
-        protected void alertAuthorisationFailed() {
-            HelpAwareOptionPane.showOptionDialog(
-                    FullyAutomaticAuthorizationUI.this,
-                    tr("<html>"
-                            + "The automatic process for retrieving an OAuth Access Token<br>"
-                            + "from the OSM server failed.<br><br>"
-                            + "Please try again or choose another kind of authorization process,<br>"
-                            + "i.e. semi-automatic or manual authorization."
-                            +"</html>"),
-                    tr("OAuth authorization failed"),
-                    JOptionPane.ERROR_MESSAGE,
-                    HelpUtil.ht("/Dialog/OAuthAuthorisationWizard#FullyAutomaticProcessFailed")
-            );
-        }
-
-        protected void alertInvalidLoginUrl() {
-            HelpAwareOptionPane.showOptionDialog(
-                    FullyAutomaticAuthorizationUI.this,
-                    tr("<html>"
-                            + "The automatic process for retrieving an OAuth Access Token<br>"
-                            + "from the OSM server failed because JOSM was not able to build<br>"
-                            + "a valid login URL from the OAuth Authorize Endpoint URL ''{0}''.<br><br>"
-                            + "Please check your advanced setting and try again."
-                            + "</html>",
-                            getAdvancedPropertiesPanel().getAdvancedParameters().getAuthorizationUrl()),
-                    tr("OAuth authorization failed"),
-                    JOptionPane.ERROR_MESSAGE,
-                    HelpUtil.ht("/Dialog/OAuthAuthorisationWizard#FullyAutomaticProcessFailed")
-            );
-        }
-
-        protected void handleException(final OsmOAuthAuthorizationException e) {
-            Logging.error(e);
-            GuiHelper.runInEDT(this::alertAuthorisationFailed);
-        }
-
-        @Override
-        protected void realRun() throws SAXException, IOException, OsmTransferException {
-            getProgressMonitor().setTicksCount(2);
-            OAuthAuthorizationWizard.authorize(true, token -> {
-                if (!canceled) {
-                    getProgressMonitor().worked(1);
-                    GuiHelper.runInEDT(() -> {
-                        prepareUIForResultDisplay();
-                        setAccessToken(token.orElse(null));
-                    });
-                }
-            }, getApiUrl(), getOAuthVersion(), getOAuthParameters());
-            getProgressMonitor().worked(1);
-        }
-    }
-}
diff --git src/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanel.java src/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanel.java
deleted file mode 100644
index eaa228b1b5..0000000000
--- src/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanel.java
+++ /dev/null
@@ -1,80 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.oauth;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-
-import javax.swing.BorderFactory;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-import org.openstreetmap.josm.gui.preferences.server.UserNameValidator;
-import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
-import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
-
-/**
- * Panel to enter username and password for the "fully automatic" authorization
- * procedure.
- *
- * @see AuthorizationProcedure#FULLY_AUTOMATIC
- */
-public class FullyAutomaticPropertiesPanel extends JPanel {
-
-    private final JosmTextField tfUserName = new JosmTextField();
-    private final JosmPasswordField tfPassword = new JosmPasswordField();
-
-    /**
-     * Constructs a new {@code FullyAutomaticPropertiesPanel}.
-     */
-    public FullyAutomaticPropertiesPanel() {
-        setLayout(new GridBagLayout());
-        GridBagConstraints gc = new GridBagConstraints();
-        setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
-
-        gc.anchor = GridBagConstraints.NORTHWEST;
-        gc.fill = GridBagConstraints.HORIZONTAL;
-        gc.weightx = 1.0;
-        add(buildUserNamePasswordPanel(), gc);
-
-        gc.gridy = 1;
-        gc.weighty = 1.0;
-        gc.fill = GridBagConstraints.BOTH;
-        add(new JPanel(), gc);
-    }
-
-    protected final JPanel buildUserNamePasswordPanel() {
-        JPanel pnl = new JPanel(new GridBagLayout());
-        GridBagConstraints gc = new GridBagConstraints();
-
-        gc.anchor = GridBagConstraints.NORTHWEST;
-        gc.fill = GridBagConstraints.HORIZONTAL;
-        gc.weightx = 0.0;
-        gc.insets = new Insets(0, 0, 3, 3);
-        pnl.add(new JLabel(tr("Username: ")), gc);
-
-        gc.gridx = 1;
-        gc.weightx = 1.0;
-        pnl.add(tfUserName, gc);
-        SelectAllOnFocusGainedDecorator.decorate(tfUserName);
-        UserNameValidator valUserName = new UserNameValidator(tfUserName);
-        valUserName.validate();
-
-        gc.anchor = GridBagConstraints.NORTHWEST;
-        gc.fill = GridBagConstraints.HORIZONTAL;
-        gc.gridy = 1;
-        gc.gridx = 0;
-        gc.weightx = 0.0;
-        pnl.add(new JLabel(tr("Password:")), gc);
-
-        gc.gridx = 1;
-        gc.weightx = 1.0;
-        pnl.add(tfPassword, gc);
-        SelectAllOnFocusGainedDecorator.decorate(tfPassword);
-
-        return pnl;
-    }
-}
diff --git src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java
deleted file mode 100644
index 3a393f4f11..0000000000
--- src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java
+++ /dev/null
@@ -1,238 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.oauth;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.BorderLayout;
-import java.awt.FlowLayout;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.concurrent.Executor;
-
-import javax.swing.AbstractAction;
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JTabbedPane;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.text.JTextComponent;
-
-import org.openstreetmap.josm.data.oauth.OAuth20Exception;
-import org.openstreetmap.josm.data.oauth.OAuth20Token;
-import org.openstreetmap.josm.data.oauth.OAuthAccessTokenHolder;
-import org.openstreetmap.josm.data.oauth.OAuthVersion;
-import org.openstreetmap.josm.gui.widgets.DefaultTextComponentValidator;
-import org.openstreetmap.josm.gui.widgets.HtmlPanel;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
-import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
-import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.tools.JosmRuntimeException;
-
-/**
- * This is an UI which supports a JOSM user to get an OAuth Access Token in a fully manual process.
- *
- * @since 2746
- */
-public class ManualAuthorizationUI extends AbstractAuthorizationUI {
-
-    private final JosmTextField tfAccessTokenKey = new JosmTextField();
-    private transient AccessTokenKeyValidator valAccessTokenKey;
-    private final JCheckBox cbSaveToPreferences = new JCheckBox(tr("Save Access Token in preferences"));
-    private final HtmlPanel pnlMessage = new HtmlPanel();
-    private final transient Executor executor;
-
-    /**
-     * Constructs a new {@code ManualAuthorizationUI} for the given API URL.
-     * @param apiUrl The OSM API URL
-     * @param executor the executor used for running the HTTP requests for the authorization
-     * @param oAuthVersion The OAuthVersion to use for this UI
-     * @since 18991
-     */
-    public ManualAuthorizationUI(String apiUrl, Executor executor, OAuthVersion oAuthVersion) {
-        super(null /* don't pass apiURL because setApiUrl is overridden and references a local field */,
-                oAuthVersion);
-        setApiUrl(apiUrl);
-        this.executor = executor;
-        build();
-    }
-
-    protected JPanel buildAccessTokenPanel() {
-        JPanel pnl = new JPanel(new GridBagLayout());
-        pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
-        GridBagConstraints gc = new GridBagConstraints();
-        AccessTokenBuilder accessTokenBuilder = new AccessTokenBuilder();
-
-        // the access token key input field
-        gc.anchor = GridBagConstraints.NORTHWEST;
-        gc.fill = GridBagConstraints.HORIZONTAL;
-        gc.weightx = 0.0;
-        gc.gridwidth = 2;
-        gc.insets = new Insets(0, 0, 5, 0);
-        pnlMessage.setText("<html><body>"
-                + tr("Please enter an OAuth Access Token which is authorized to access the OSM server "
-                        + "''{0}''.",
-                        getApiUrl()) + "</body></html>");
-        pnl.add(pnlMessage, gc);
-
-        // the access token key input field
-        gc.gridy = 1;
-        gc.weightx = 0.0;
-        gc.gridwidth = 1;
-        gc.insets = new Insets(0, 0, 0, 3);
-        pnl.add(new JLabel(tr("Access Token Key:")), gc);
-
-        gc.gridx = 1;
-        gc.weightx = 1.0;
-        pnl.add(tfAccessTokenKey, gc);
-        SelectAllOnFocusGainedDecorator.decorate(tfAccessTokenKey);
-        valAccessTokenKey = new AccessTokenKeyValidator(tfAccessTokenKey);
-        valAccessTokenKey.validate();
-        tfAccessTokenKey.getDocument().addDocumentListener(accessTokenBuilder);
-
-        // the checkbox for saving to preferences
-        gc.gridy = 3;
-        gc.gridx = 0;
-        gc.gridwidth = 2;
-        gc.weightx = 1.0;
-        pnl.add(cbSaveToPreferences, gc);
-        cbSaveToPreferences.setSelected(OAuthAccessTokenHolder.getInstance().isSaveToPreferences());
-
-        // filler - grab remaining space
-        gc.gridy = 3;
-        gc.gridx = 0;
-        gc.gridwidth = 2;
-        gc.weightx = 1.0;
-        gc.weighty = 1.0;
-        gc.fill = GridBagConstraints.BOTH;
-        pnl.add(new JPanel(), gc);
-        return pnl;
-    }
-
-    protected JPanel buildTabbedPreferencesPanel() {
-        JPanel pnl = new JPanel(new BorderLayout());
-
-        JTabbedPane tp = new JTabbedPane();
-        tp.add(buildAccessTokenPanel());
-        tp.add(getAdvancedPropertiesPanel());
-
-        tp.setTitleAt(0, tr("Access Token"));
-        tp.setTitleAt(1, tr("Advanced OAuth parameters"));
-
-        tp.setToolTipTextAt(0, tr("Enter the OAuth Access Token"));
-        tp.setToolTipTextAt(1, tr("Enter advanced OAuth properties"));
-
-        pnl.add(tp, BorderLayout.CENTER);
-        return pnl;
-    }
-
-    protected JPanel buildActionsPanel() {
-        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
-        TestAccessTokenAction actTestAccessToken = new TestAccessTokenAction();
-        pnl.add(new JButton(actTestAccessToken));
-        this.addPropertyChangeListener(actTestAccessToken);
-        return pnl;
-    }
-
-    @Override
-    public void setApiUrl(String apiUrl) {
-        super.setApiUrl(apiUrl);
-        if (pnlMessage != null) {
-            pnlMessage.setText(tr("<html><body>"
-                    + "Please enter an OAuth Access Token which is authorized to access the OSM server "
-                    + "''{0}''."
-                    + "</body></html>",
-                    getApiUrl()
-            ));
-        }
-    }
-
-    protected final void build() {
-        setLayout(new BorderLayout());
-        setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
-        add(buildTabbedPreferencesPanel(), BorderLayout.CENTER);
-        add(buildActionsPanel(), BorderLayout.SOUTH);
-    }
-
-    @Override
-    public boolean isSaveAccessTokenToPreferences() {
-        return cbSaveToPreferences.isSelected();
-    }
-
-    private static class AccessTokenKeyValidator extends DefaultTextComponentValidator {
-        AccessTokenKeyValidator(JTextComponent tc) {
-            super(tc, tr("Please enter an Access Token Key"),
-                      tr("The Access Token Key must not be empty. Please enter an Access Token Key"));
-        }
-    }
-
-    class AccessTokenBuilder implements DocumentListener {
-
-        public void build() {
-            if (!valAccessTokenKey.isValid()) {
-                setAccessToken(null);
-            } else {
-                try {
-                    setAccessToken(new OAuth20Token(getOAuthParameters(), "{\"token_type\":\"bearer\", \"access_token\":\""
-                            + tfAccessTokenKey.getText().trim() + "\"}"));
-                } catch (OAuth20Exception e) {
-                    throw new JosmRuntimeException(e);
-                }
-            }
-        }
-
-        @Override
-        public void changedUpdate(DocumentEvent e) {
-            build();
-        }
-
-        @Override
-        public void insertUpdate(DocumentEvent e) {
-            build();
-        }
-
-        @Override
-        public void removeUpdate(DocumentEvent e) {
-            build();
-        }
-    }
-
-    /**
-     * Action for testing an Access Token
-     */
-    class TestAccessTokenAction extends AbstractAction implements PropertyChangeListener {
-        TestAccessTokenAction() {
-            putValue(NAME, tr("Test Access Token"));
-            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
-            putValue(SHORT_DESCRIPTION, tr("Click to test the Access Token"));
-            updateEnabledState();
-        }
-
-        @Override
-        public void actionPerformed(ActionEvent evt) {
-            TestAccessTokenTask task = new TestAccessTokenTask(
-                    ManualAuthorizationUI.this,
-                    getApiUrl(),
-                    getAccessToken()
-            );
-            executor.execute(task);
-        }
-
-        protected final void updateEnabledState() {
-            setEnabled(hasAccessToken());
-        }
-
-        @Override
-        public void propertyChange(PropertyChangeEvent evt) {
-            if (!evt.getPropertyName().equals(AbstractAuthorizationUI.ACCESS_TOKEN_PROP))
-                return;
-            updateEnabledState();
-        }
-    }
-}
diff --git src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java
deleted file mode 100644
index a4ff52d723..0000000000
--- src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java
+++ /dev/null
@@ -1,450 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.oauth;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.concurrent.Executor;
-import java.util.concurrent.FutureTask;
-import java.util.function.Consumer;
-
-import javax.swing.AbstractAction;
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.text.html.HTMLEditorKit;
-
-import org.openstreetmap.josm.data.oauth.IOAuthParameters;
-import org.openstreetmap.josm.data.oauth.IOAuthToken;
-import org.openstreetmap.josm.data.oauth.OAuth20Authorization;
-import org.openstreetmap.josm.data.oauth.OAuthAccessTokenHolder;
-import org.openstreetmap.josm.data.oauth.OAuthParameters;
-import org.openstreetmap.josm.data.oauth.OAuthVersion;
-import org.openstreetmap.josm.data.oauth.osm.OsmScopes;
-import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
-import org.openstreetmap.josm.gui.help.HelpUtil;
-import org.openstreetmap.josm.gui.util.GuiHelper;
-import org.openstreetmap.josm.gui.util.WindowGeometry;
-import org.openstreetmap.josm.gui.widgets.HtmlPanel;
-import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
-import org.openstreetmap.josm.io.auth.CredentialsManager;
-import org.openstreetmap.josm.io.remotecontrol.RemoteControl;
-import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.tools.GBC;
-import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.tools.InputMapUtils;
-import org.openstreetmap.josm.tools.UserCancelException;
-import org.openstreetmap.josm.tools.Utils;
-
-/**
- * This wizard walks the user to the necessary steps to retrieve an OAuth Access Token which
- * allows JOSM to access the OSM API on the users behalf.
- * @since 2746
- */
-public class OAuthAuthorizationWizard extends JDialog {
-    private boolean canceled;
-    private final AuthorizationProcedure procedure;
-    private final String apiUrl;
-    private final OAuthVersion oAuthVersion;
-
-    private FullyAutomaticAuthorizationUI pnlFullyAutomaticAuthorisationUI;
-    private ManualAuthorizationUI pnlManualAuthorisationUI;
-    private JScrollPane spAuthorisationProcedureUI;
-    private final transient Executor executor;
-
-    /**
-     * Launches the wizard, {@link OAuthAccessTokenHolder#setAccessToken(String, IOAuthToken)} sets the token
-     * and {@link OAuthAccessTokenHolder#setSaveToPreferences(boolean) saves to preferences}.
-     * @param callback Callback to run when authorization is finished
-     * @throws UserCancelException if user cancels the operation
-     */
-    public void showDialog(Consumer<Optional<IOAuthToken>> callback) throws UserCancelException {
-        if ((this.oAuthVersion == OAuthVersion.OAuth20 || this.oAuthVersion == OAuthVersion.OAuth21)
-        && this.procedure == AuthorizationProcedure.FULLY_AUTOMATIC) {
-            authorize(true, callback, this.apiUrl, this.oAuthVersion, getOAuthParameters());
-        } else {
-            setVisible(true);
-            if (isCanceled()) {
-                throw new UserCancelException();
-            }
-            OAuthAccessTokenHolder holder = OAuthAccessTokenHolder.getInstance();
-            holder.setAccessToken(apiUrl, getAccessToken());
-            holder.setSaveToPreferences(isSaveAccessTokenToPreferences());
-        }
-    }
-
-    /**
-     * Perform the oauth dance
-     *
-     * @param startRemoteControl {@code true} to start remote control if it is not already running
-     * @param callback           The callback to use to notify that the OAuth dance succeeded
-     * @param apiUrl             The API URL to get the token for
-     * @param oAuthVersion       The OAuth version that the authorization dance is force
-     * @param oAuthParameters    The OAuth parameters to use
-     */
-    static void authorize(boolean startRemoteControl, Consumer<Optional<IOAuthToken>> callback, String apiUrl,
-                          OAuthVersion oAuthVersion, IOAuthParameters oAuthParameters) {
-        final boolean remoteControlIsRunning = Boolean.TRUE.equals(RemoteControl.PROP_REMOTECONTROL_ENABLED.get());
-        // TODO: Ask user if they want to start remote control?
-        if (!remoteControlIsRunning && startRemoteControl) {
-            RemoteControl.start();
-        }
-        new OAuth20Authorization().authorize(
-                Optional.ofNullable(oAuthParameters).orElseGet(() -> OAuthParameters.createDefault(apiUrl, oAuthVersion)),
-                token -> {
-                    if (!remoteControlIsRunning) {
-                        RemoteControl.stop();
-                    }
-                    OAuthAccessTokenHolder.getInstance().setAccessToken(apiUrl, token.orElse(null));
-                    OAuthAccessTokenHolder.getInstance().save(CredentialsManager.getInstance());
-                    if (!token.isPresent()) {
-                        GuiHelper.runInEDT(() -> JOptionPane.showMessageDialog(MainApplication.getMainPanel(),
-                                tr("Authentication failed, please check browser for details."),
-                                tr("OAuth Authentication Failed"),
-                                JOptionPane.ERROR_MESSAGE));
-                    }
-                    if (callback != null) {
-                        callback.accept(token);
-                    }
-                }, OsmScopes.read_gpx, OsmScopes.write_gpx,
-                OsmScopes.read_prefs, OsmScopes.write_prefs,
-                OsmScopes.write_api, OsmScopes.write_notes);
-    }
-
-    /**
-     * Builds the row with the action buttons
-     *
-     * @return panel with buttons
-     */
-    protected JPanel buildButtonRow() {
-        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.CENTER));
-
-        AcceptAccessTokenAction actAcceptAccessToken = new AcceptAccessTokenAction();
-        pnlFullyAutomaticAuthorisationUI.addPropertyChangeListener(actAcceptAccessToken);
-        pnlManualAuthorisationUI.addPropertyChangeListener(actAcceptAccessToken);
-
-        pnl.add(new JButton(actAcceptAccessToken));
-        pnl.add(new JButton(new CancelAction()));
-        pnl.add(new JButton(new ContextSensitiveHelpAction(HelpUtil.ht("/Dialog/OAuthAuthorisationWizard"))));
-
-        return pnl;
-    }
-
-    /**
-     * Builds the panel with general information in the header
-     *
-     * @return panel with information display
-     */
-    protected JPanel buildHeaderInfoPanel() {
-        JPanel pnl = new JPanel(new GridBagLayout());
-        pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
-
-        // OAuth in a nutshell ...
-        HtmlPanel pnlMessage = new HtmlPanel();
-        pnlMessage.setText("<html><body>"
-                + tr("With OAuth you grant JOSM the right to upload map data and GPS tracks "
-                        + "on your behalf (<a href=\"{0}\">more info...</a>).", "https://wiki.openstreetmap.org/wiki/OAuth")
-                        + "</body></html>"
-        );
-        pnlMessage.enableClickableHyperlinks();
-        pnl.add(pnlMessage, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
-
-        // the authorisation procedure
-        JMultilineLabel lbl = new JMultilineLabel(AuthorizationProcedure.FULLY_AUTOMATIC.getDescription());
-        lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN));
-        pnl.add(lbl, GBC.eol());
-
-        if (!Config.getUrls().getDefaultOsmApiUrl().equals(apiUrl)) {
-            final HtmlPanel pnlWarning = new HtmlPanel();
-            final HTMLEditorKit kit = (HTMLEditorKit) pnlWarning.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;}");
-            kit.getStyleSheet().addRule("ol {margin-left: 1cm}");
-            pnlWarning.setText("<html><body>"
-                    + "<p class=\"warning-body\">"
-                    + tr("<strong>Warning:</strong> Since you are using not the default OSM API, " +
-                    "make sure to set an OAuth consumer key and secret in the <i>Advanced OAuth parameters</i>.")
-                    + "</p>"
-                    + "</body></html>");
-            pnl.add(pnlWarning, GBC.eop().fill());
-        }
-
-        return pnl;
-    }
-
-    /**
-     * Refreshes the view of the authorisation panel, depending on the authorisation procedure
-     * currently selected
-     */
-    protected void refreshAuthorisationProcedurePanel() {
-        switch (procedure) {
-        case FULLY_AUTOMATIC:
-            spAuthorisationProcedureUI.getViewport().setView(pnlFullyAutomaticAuthorisationUI);
-            pnlFullyAutomaticAuthorisationUI.revalidate();
-            break;
-        case MANUALLY:
-            spAuthorisationProcedureUI.getViewport().setView(pnlManualAuthorisationUI);
-            pnlManualAuthorisationUI.revalidate();
-            break;
-        default:
-            throw new UnsupportedOperationException("Unsupported auth type: " + procedure);
-        }
-        validate();
-        repaint();
-    }
-
-    /**
-     * builds the UI
-     */
-    protected final void build() {
-        getContentPane().setLayout(new BorderLayout());
-        getContentPane().add(buildHeaderInfoPanel(), BorderLayout.NORTH);
-
-        setTitle(tr("Get an Access Token for ''{0}''", apiUrl));
-        this.setMinimumSize(new Dimension(500, 300));
-
-        pnlFullyAutomaticAuthorisationUI = new FullyAutomaticAuthorizationUI(apiUrl, executor, oAuthVersion);
-        pnlManualAuthorisationUI = new ManualAuthorizationUI(apiUrl, executor, oAuthVersion);
-
-        spAuthorisationProcedureUI = GuiHelper.embedInVerticalScrollPane(new JPanel());
-        spAuthorisationProcedureUI.getVerticalScrollBar().addComponentListener(
-                new ComponentAdapter() {
-                    @Override
-                    public void componentShown(ComponentEvent e) {
-                        spAuthorisationProcedureUI.setBorder(UIManager.getBorder("ScrollPane.border"));
-                    }
-
-                    @Override
-                    public void componentHidden(ComponentEvent e) {
-                        spAuthorisationProcedureUI.setBorder(null);
-                    }
-                }
-        );
-        getContentPane().add(spAuthorisationProcedureUI, BorderLayout.CENTER);
-        getContentPane().add(buildButtonRow(), BorderLayout.SOUTH);
-
-        addWindowListener(new WindowEventHandler());
-        InputMapUtils.addEscapeAction(getRootPane(), new CancelAction());
-
-        refreshAuthorisationProcedurePanel();
-
-        HelpUtil.setHelpContext(getRootPane(), HelpUtil.ht("/Dialog/OAuthAuthorisationWizard"));
-    }
-
-    /**
-     * Creates the wizard.
-     *
-     * @param parent             the component relative to which the dialog is displayed
-     * @param procedure          the authorization procedure to use
-     * @param apiUrl             the API URL. Must not be null.
-     * @param executor           the executor used for running the HTTP requests for the authorization
-     * @param oAuthVersion       The OAuth version this wizard is for
-     * @param advancedParameters The OAuth parameters to initialize the wizard with
-     * @throws IllegalArgumentException if apiUrl is null
-     */
-    public OAuthAuthorizationWizard(Component parent, AuthorizationProcedure procedure, String apiUrl,
-                                    Executor executor, OAuthVersion oAuthVersion, IOAuthParameters advancedParameters) {
-        super(GuiHelper.getFrameForComponent(parent), ModalityType.DOCUMENT_MODAL);
-        this.procedure = Objects.requireNonNull(procedure, "procedure");
-        this.apiUrl = Objects.requireNonNull(apiUrl, "apiUrl");
-        this.executor = executor;
-        this.oAuthVersion = oAuthVersion;
-        build();
-        if (advancedParameters != null) {
-            pnlFullyAutomaticAuthorisationUI.getAdvancedPropertiesPanel().setAdvancedParameters(advancedParameters);
-            pnlManualAuthorisationUI.getAdvancedPropertiesPanel().setAdvancedParameters(advancedParameters);
-        }
-    }
-
-    /**
-     * Replies true if the dialog was canceled
-     *
-     * @return true if the dialog was canceled
-     */
-    public boolean isCanceled() {
-        return canceled;
-    }
-
-    protected AbstractAuthorizationUI getCurrentAuthorisationUI() {
-        switch (procedure) {
-        case FULLY_AUTOMATIC: return pnlFullyAutomaticAuthorisationUI;
-        case MANUALLY: return pnlManualAuthorisationUI;
-        default: return null;
-        }
-    }
-
-    /**
-     * Replies the Access Token entered using the wizard
-     *
-     * @return the access token. May be null if the wizard was canceled.
-     */
-    public IOAuthToken getAccessToken() {
-        return getCurrentAuthorisationUI().getAccessToken();
-    }
-
-    /**
-     * Replies the current OAuth parameters.
-     *
-     * @return the current OAuth parameters.
-     */
-    public IOAuthParameters getOAuthParameters() {
-        return getCurrentAuthorisationUI().getOAuthParameters();
-    }
-
-    /**
-     * Replies true if the currently selected Access Token shall be saved to
-     * the preferences.
-     *
-     * @return true if the currently selected Access Token shall be saved to
-     * the preferences
-     */
-    public boolean isSaveAccessTokenToPreferences() {
-        return getCurrentAuthorisationUI().isSaveAccessTokenToPreferences();
-    }
-
-    /**
-     * Initializes the dialog with values from the preferences
-     *
-     */
-    public void initFromPreferences() {
-        pnlFullyAutomaticAuthorisationUI.initialize(apiUrl);
-        pnlManualAuthorisationUI.initialize(apiUrl);
-    }
-
-    @Override
-    public void setVisible(boolean visible) {
-        if (visible) {
-            pack();
-            new WindowGeometry(
-                    getClass().getName() + ".geometry",
-                    WindowGeometry.centerInWindow(
-                            MainApplication.getMainFrame(),
-                            getPreferredSize()
-                    )
-            ).applySafe(this);
-            initFromPreferences();
-        } else if (isShowing()) { // Avoid IllegalComponentStateException like in #8775
-            new WindowGeometry(this).remember(getClass().getName() + ".geometry");
-        }
-        super.setVisible(visible);
-    }
-
-    protected void setCanceled(boolean canceled) {
-        this.canceled = canceled;
-    }
-
-    /**
-     * Obtains an OAuth access token for the connection. Afterwards, the token is accessible via {@link OAuthAccessTokenHolder}.
-     * @param serverUrl the URL to OSM server
-     * @throws InterruptedException if we're interrupted while waiting for the event dispatching thread to finish OAuth authorization task
-     * @throws InvocationTargetException if an exception is thrown while running OAuth authorization task
-     * @since 12803
-     */
-    public static void obtainAccessToken(final URL serverUrl) throws InvocationTargetException, InterruptedException {
-        final Runnable authTask = new FutureTask<>(() -> {
-            // Concerning Utils.newDirectExecutor: Main worker cannot be used since this connection is already
-            // executed via main worker. The OAuth connections would block otherwise.
-            final OAuthAuthorizationWizard wizard = new OAuthAuthorizationWizard(
-                    MainApplication.getMainFrame(),
-                    AuthorizationProcedure.FULLY_AUTOMATIC,
-                    serverUrl.toString(), Utils.newDirectExecutor(),
-                    OAuthVersion.OAuth20, null);
-            wizard.showDialog(null);
-            return wizard;
-        });
-        // exception handling differs from implementation at GuiHelper.runInEDTAndWait()
-        if (SwingUtilities.isEventDispatchThread()) {
-            authTask.run();
-        } else {
-            SwingUtilities.invokeAndWait(authTask);
-        }
-    }
-
-    class CancelAction extends AbstractAction {
-
-        /**
-         * Constructs a new {@code CancelAction}.
-         */
-        CancelAction() {
-            putValue(NAME, tr("Cancel"));
-            new ImageProvider("cancel").getResource().attachImageIcon(this);
-            putValue(SHORT_DESCRIPTION, tr("Close the dialog and cancel authorization"));
-        }
-
-        public void cancel() {
-            setCanceled(true);
-            setVisible(false);
-        }
-
-        @Override
-        public void actionPerformed(ActionEvent evt) {
-            cancel();
-        }
-    }
-
-    class AcceptAccessTokenAction extends AbstractAction implements PropertyChangeListener {
-
-        /**
-         * Constructs a new {@code AcceptAccessTokenAction}.
-         */
-        AcceptAccessTokenAction() {
-            putValue(NAME, tr("Accept Access Token"));
-            new ImageProvider("ok").getResource().attachImageIcon(this);
-            putValue(SHORT_DESCRIPTION, tr("Close the dialog and accept the Access Token"));
-            updateEnabledState(null);
-        }
-
-        @Override
-        public void actionPerformed(ActionEvent evt) {
-            setCanceled(false);
-            setVisible(false);
-        }
-
-        /**
-         * Update the enabled state
-         * @param token The token to use
-         * @since 18991
-         */
-        public final void updateEnabledState(IOAuthToken token) {
-            setEnabled(token != null);
-        }
-
-        @Override
-        public void propertyChange(PropertyChangeEvent evt) {
-            if (!evt.getPropertyName().equals(AbstractAuthorizationUI.ACCESS_TOKEN_PROP))
-                return;
-            updateEnabledState((IOAuthToken) evt.getNewValue());
-        }
-    }
-
-    class WindowEventHandler extends WindowAdapter {
-        @Override
-        public void windowClosing(WindowEvent e) {
-            new CancelAction().cancel();
-        }
-    }
-}
diff --git src/org/openstreetmap/josm/gui/oauth/OsmPrivilegesPanel.java src/org/openstreetmap/josm/gui/oauth/OsmPrivilegesPanel.java
deleted file mode 100644
index 75fed5b180..0000000000
--- src/org/openstreetmap/josm/gui/oauth/OsmPrivilegesPanel.java
+++ /dev/null
@@ -1,114 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.oauth;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-
-import javax.swing.BorderFactory;
-import javax.swing.JCheckBox;
-import javax.swing.JPanel;
-
-import org.openstreetmap.josm.data.oauth.OsmPrivileges;
-import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
-
-/**
- * Panel letting the user choose from a detailed list of privileges that will be 
- * requested for the OAuth token.
- */
-public class OsmPrivilegesPanel extends VerticallyScrollablePanel {
-
-    private final JCheckBox cbWriteApi = new JCheckBox();
-    private final JCheckBox cbWriteGpx = new JCheckBox();
-    private final JCheckBox cbReadGpx = new JCheckBox();
-    private final JCheckBox cbWritePrefs = new JCheckBox();
-    private final JCheckBox cbReadPrefs = new JCheckBox();
-    private final JCheckBox cbModifyNotes = new JCheckBox();
-
-    /**
-     * Constructs a new {@code OsmPrivilegesPanel}.
-     */
-    public OsmPrivilegesPanel() {
-        build();
-    }
-
-    protected final void build() {
-        setLayout(new GridBagLayout());
-        GridBagConstraints gc = new GridBagConstraints();
-        setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
-
-        // checkbox for "allow to upload map data"
-        //
-        gc.anchor = GridBagConstraints.NORTHWEST;
-        gc.fill = GridBagConstraints.HORIZONTAL;
-        gc.weightx = 1.0;
-        gc.insets = new Insets(0, 0, 3, 3);
-        add(cbWriteApi, gc);
-        cbWriteApi.setText(tr("Allow to upload map data"));
-        cbWriteApi.setToolTipText(tr("Select to grant JOSM the right to upload map data on your behalf"));
-        cbWriteApi.setSelected(true);
-
-        // checkbox for "allow to upload gps traces"
-        //
-        gc.gridy = 1;
-        add(cbWriteGpx, gc);
-        cbWriteGpx.setText(tr("Allow to upload GPS traces"));
-        cbWriteGpx.setToolTipText(tr("Select to grant JOSM the right to upload GPS traces on your behalf"));
-        cbWriteGpx.setSelected(true);
-
-        // checkbox for "allow to download private gps traces"
-        //
-        gc.gridy = 2;
-        add(cbReadGpx, gc);
-        cbReadGpx.setText(tr("Allow to download your private GPS traces"));
-        cbReadGpx.setToolTipText(tr("Select to grant JOSM the right to download your private GPS traces into JOSM layers"));
-        cbReadGpx.setSelected(true);
-
-        // checkbox for "allow to download private gps traces"
-        //
-        gc.gridy = 3;
-        add(cbReadPrefs, gc);
-        cbReadPrefs.setText(tr("Allow to read your preferences"));
-        cbReadPrefs.setToolTipText(tr("Select to grant JOSM the right to read your server preferences"));
-        cbReadPrefs.setSelected(true);
-
-        // checkbox for "allow to download private gps traces"
-        //
-        gc.gridy = 4;
-        add(cbWritePrefs, gc);
-        cbWritePrefs.setText(tr("Allow to write your preferences"));
-        cbWritePrefs.setToolTipText(tr("Select to grant JOSM the right to write your server preferences"));
-        cbWritePrefs.setSelected(true);
-
-        gc.gridy = 5;
-        add(cbModifyNotes, gc);
-        cbModifyNotes.setText(tr("Allow modifications of notes"));
-        cbModifyNotes.setToolTipText(tr("Select to grant JOSM the right to modify notes on your behalf"));
-        cbModifyNotes.setSelected(true);
-
-        // filler - grab remaining space
-        gc.gridy = 6;
-        gc.fill = GridBagConstraints.BOTH;
-        gc.weightx = 1.0;
-        gc.weighty = 1.0;
-        add(new JPanel(), gc);
-    }
-
-    /**
-     * Replies the currently entered privileges
-     *
-     * @return the privileges
-     */
-    public OsmPrivileges getPrivileges() {
-        OsmPrivileges privileges = new OsmPrivileges();
-        privileges.setAllowWriteApi(cbWriteApi.isSelected());
-        privileges.setAllowWriteGpx(cbWriteGpx.isSelected());
-        privileges.setAllowReadGpx(cbReadGpx.isSelected());
-        privileges.setAllowWritePrefs(cbWritePrefs.isSelected());
-        privileges.setAllowReadPrefs(cbReadPrefs.isSelected());
-        privileges.setAllowModifyNotes(cbModifyNotes.isSelected());
-        return privileges;
-    }
-}
diff --git src/org/openstreetmap/josm/gui/oauth/package-info.java src/org/openstreetmap/josm/gui/oauth/package-info.java
index 658179245b..b25f6f817b 100644
--- src/org/openstreetmap/josm/gui/oauth/package-info.java
+++ src/org/openstreetmap/josm/gui/oauth/package-info.java
@@ -1,7 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 
 /**
- * Provides GUI classes for handling OAuth authentication to OSM API.
- * Backend is <a href="https://github.com/mttkay/signpost">OAuth Signpost</a>.
+ * Provides GUI classes for handling OAuth 2.0 authentication to the OSM API.
  */
 package org.openstreetmap.josm.gui.oauth;
diff --git src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
index f2792c6d43..2179028bed 100644
--- src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
+++ src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
@@ -17,6 +17,7 @@ import javax.swing.ButtonGroup;
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
 
+import org.openstreetmap.josm.actions.ExpertToggleAction;
 import org.openstreetmap.josm.data.UserIdentityManager;
 import org.openstreetmap.josm.data.oauth.OAuthAccessTokenHolder;
 import org.openstreetmap.josm.data.oauth.OAuthVersion;
@@ -35,6 +36,11 @@ import org.openstreetmap.josm.tools.Logging;
  */
 public class AuthenticationPreferencesPanel extends VerticallyScrollablePanel implements PropertyChangeListener {
 
+    /** the choice of the authentication method; only shown to experts, see {@link #updateAuthenticationMethodVisibility()} */
+    private final JPanel pnlAuthenticationMethod = new JPanel(new FlowLayout(FlowLayout.LEADING));
+    /** follows expert mode; held here since {@link ExpertToggleAction} only keeps a weak reference to its listeners */
+    private final transient ExpertToggleAction.ExpertModeChangeListener expertModeListener =
+            isExpert -> updateAuthenticationMethodVisibility();
     /** indicates whether we use basic authentication */
     private final JRadioButton rbBasicAuthentication = new JRadioButton();
     /** indicates whether we use OAuth 2.0 as authentication scheme */
@@ -63,20 +69,20 @@ public class AuthenticationPreferencesPanel extends VerticallyScrollablePanel im
 
         AuthenticationMethodChangeListener authChangeListener = new AuthenticationMethodChangeListener();
 
-        JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
         // -- radio button for basic authentication
-        buttonPanel.add(rbBasicAuthentication);
+        pnlAuthenticationMethod.add(rbBasicAuthentication);
         rbBasicAuthentication.setText(tr("Use Basic Authentication"));
         rbBasicAuthentication.setToolTipText(tr("Select to use HTTP basic authentication with your OSM username and password"));
         rbBasicAuthentication.addItemListener(authChangeListener);
         //-- radio button for OAuth 2.0
-        buttonPanel.add(rbOAuth20);
+        pnlAuthenticationMethod.add(rbOAuth20);
         rbOAuth20.setSelected(true); // This must before adding the listener; otherwise, saveToPreferences is called prior to initFromPreferences
         rbOAuth20.setText(tr("Use OAuth {0}", "2.0"));
         rbOAuth20.setToolTipText(tr("Select to use OAuth {0} as authentication mechanism", "2.0"));
         rbOAuth20.addItemListener(authChangeListener);
 
-        add(buttonPanel, GBC.eol());
+        add(pnlAuthenticationMethod, GBC.eol());
+        ExpertToggleAction.addExpertModeChangeListener(expertModeListener);
         //-- radio button for OAuth
         ButtonGroup bg = new ButtonGroup();
         bg.add(rbBasicAuthentication);
@@ -119,6 +125,17 @@ public class AuthenticationPreferencesPanel extends VerticallyScrollablePanel im
         }
         pnlBasicAuthPreferences.initFromPreferences();
         pnlOAuth20Preferences.initFromPreferences();
+        updateAuthenticationMethodVisibility();
+    }
+
+    /**
+     * Shows the choice of the authentication method in expert mode only, since basic authentication is meant as a
+     * quick way to test one's own server rather than for normal use. It is shown regardless while basic
+     * authentication is selected, so that a profile using it does not lose sight of its own setting. Selecting
+     * another method does not hide the choice straight away, which would take the option away under the mouse.
+     */
+    private void updateAuthenticationMethodVisibility() {
+        pnlAuthenticationMethod.setVisible(ExpertToggleAction.isExpert() || rbBasicAuthentication.isSelected());
     }
 
     /**
@@ -132,7 +149,7 @@ public class AuthenticationPreferencesPanel extends VerticallyScrollablePanel im
         } else if (rbOAuth20.isSelected()) {
             authMethod = "oauth20";
         } else {
-            throw new IllegalStateException("One of OAuth 2.0, OAuth 1.0a, or Basic authentication must be checked");
+            throw new IllegalStateException("One of OAuth 2.0 or Basic authentication must be checked");
         }
         final boolean initUser = Config.getPref().put("osm-server.auth-method", authMethod);
         if ("basic".equals(authMethod)) {
@@ -169,7 +186,7 @@ public class AuthenticationPreferencesPanel extends VerticallyScrollablePanel im
                 pnlBasicAuthPreferences.revalidate();
             } else if (rbOAuth20.isSelected()) {
                 pnlAuthenticationParameters.add(pnlOAuth20Preferences, BorderLayout.CENTER);
-                pnlOAuth20Preferences.saveToPreferences();
+                // only refresh it: saving here would save what was entered before the user pressed OK
                 pnlOAuth20Preferences.initFromPreferences();
                 pnlOAuth20Preferences.revalidate();
             }
@@ -188,13 +205,24 @@ public class AuthenticationPreferencesPanel extends VerticallyScrollablePanel im
     }
 
     /**
-     * Update the acceptable authentications methods
+     * Update the acceptable authentications methods: basic authentication is not offered for a server which is known
+     * not to accept it, unless it is in use already, so that it can be changed.
      * @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);
+        rbBasicAuthentication.setEnabled(rbBasicAuthentication.isSelected() || "basic".equals(authMethod)
+                || !isOAuthOnly(apiUrl));
+    }
+
+    /**
+     * Determines whether a server is known to accept OAuth 2.0 only, not basic authentication.
+     * @param apiUrl The API url to check
+     * @return {@code true} for the default OSM API and the OpenGeofiction API
+     */
+    private static boolean isOAuthOnly(String apiUrl) {
+        final String url = OsmApi.normalizeApiUrl(apiUrl);
+        return JosmUrls.getInstance().getDefaultOsmApiUrl().equals(url) || "https://opengeofiction.net/api".equals(url);
     }
 
 }
diff --git src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
index 1ceeea0347..11fc6bb6f8 100644
--- src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
+++ src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
@@ -12,55 +12,49 @@ import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.Insets;
 import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Arrays;
-import java.util.Objects;
 
 import javax.swing.AbstractAction;
 import javax.swing.BorderFactory;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
-import javax.swing.JLabel;
+import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 
-import org.openstreetmap.josm.actions.ExpertToggleAction;
+import org.openstreetmap.josm.data.oauth.IOAuthParameters;
 import org.openstreetmap.josm.data.oauth.IOAuthToken;
+import org.openstreetmap.josm.data.oauth.OAuth20Authorization;
 import org.openstreetmap.josm.data.oauth.OAuth20Token;
 import org.openstreetmap.josm.data.oauth.OAuthAccessTokenHolder;
 import org.openstreetmap.josm.data.oauth.OAuthParameters;
 import org.openstreetmap.josm.data.oauth.OAuthVersion;
+import org.openstreetmap.josm.data.oauth.osm.OsmScopes;
 import org.openstreetmap.josm.data.validation.routines.DomainValidator;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.oauth.AdvancedOAuthPropertiesPanel;
-import org.openstreetmap.josm.gui.oauth.AuthorizationProcedure;
-import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard;
 import org.openstreetmap.josm.gui.oauth.TestAccessTokenTask;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.io.auth.CredentialsManager;
+import org.openstreetmap.josm.io.remotecontrol.RemoteControl;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Logging;
-import org.openstreetmap.josm.tools.UserCancelException;
 import org.openstreetmap.josm.tools.Utils;
 
 /**
- * The preferences panel for the OAuth 1.0a preferences. This just a summary panel
- * showing the current Access Token Key and Access Token Secret, if the
- * user already has an Access Token.
- * <br>
- * For initial authorisation see {@link OAuthAuthorizationWizard}.
+ * The preferences panel for OAuth 2.0: whether JOSM has an Access Token for the server, a button to authorize JOSM
+ * in the web browser, and the advanced OAuth parameters, which include the Access Token itself so that a token
+ * obtained outside JOSM can be pasted instead.
  * @since 2745
  */
 public class OAuthAuthenticationPreferencesPanel extends JPanel implements PropertyChangeListener {
     private final JCheckBox cbUseForAllRequests = new JCheckBox();
-    private final JCheckBox cbShowAdvancedParameters = new JCheckBox(tr("Display Advanced OAuth Parameters"));
     private final JCheckBox cbSaveToPreferences = new JCheckBox(tr("Save to preferences"));
     private final JPanel pnlAuthorisationMessage = new JPanel(new BorderLayout());
     private final NotYetAuthorisedPanel pnlNotYetAuthorised;
@@ -94,12 +88,6 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
         cbUseForAllRequests.setToolTipText(tr("For user-based bandwidth limit instead of IP-based one"));
         pnl.add(cbUseForAllRequests, GBC.eol().fill(GBC.HORIZONTAL));
 
-        pnl.add(cbShowAdvancedParameters, GBC.eol().fill(GBC.HORIZONTAL));
-        cbShowAdvancedParameters.setSelected(false);
-        cbShowAdvancedParameters.addItemListener(
-                evt -> pnlAdvancedProperties.setVisible(evt.getStateChange() == ItemEvent.SELECTED)
-        );
-
         pnl.add(pnlAdvancedProperties, GBC.eol().fill(GBC.HORIZONTAL).insets(0, 3, 0, 0));
         pnlAdvancedProperties.initialize(OsmApi.getOsmApi().getServerUrl());
         pnlAdvancedProperties.setBorder(
@@ -108,7 +96,6 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
                         BorderFactory.createEmptyBorder(3, 3, 3, 3)
                 )
         );
-        pnlAdvancedProperties.setVisible(false);
         pnlAdvancedProperties.addPropertyChangeListener(this);
         return pnl;
     }
@@ -118,7 +105,7 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
      * advanced OAuth parameters changed.
      */
     private void updateAuthoriseNowActions() {
-        for (JPanel panel : Arrays.asList(this.pnlNotYetAuthorised, (JPanel) this.pnlAlreadyAuthorised.getComponent(6))) {
+        for (JPanel panel : Arrays.asList(this.pnlNotYetAuthorised, this.pnlAlreadyAuthorised.pnlButtons)) {
             for (Component component : panel.getComponents()) {
                 if (component instanceof JButton && ((JButton) component).getAction() instanceof AuthoriseNowAction) {
                     ((AuthoriseNowAction) ((JButton) component).getAction()).updateEnabledState();
@@ -144,6 +131,7 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
 
     protected void refreshView() {
         pnlAuthorisationMessage.removeAll();
+        pnlAdvancedProperties.setAccessToken(getBearerToken());
         if (OAuthAccessTokenHolder.getInstance().getAccessToken(this.apiUrl, this.oAuthVersion) != null) {
             pnlAuthorisationMessage.add(pnlAlreadyAuthorised, BorderLayout.CENTER);
             pnlAlreadyAuthorised.refreshView();
@@ -155,6 +143,49 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
         repaint();
     }
 
+    /**
+     * Get the bearer token JOSM currently has for the API.
+     * @return the bearer token, or {@code null} if there is none
+     */
+    private String getBearerToken() {
+        if (apiUrl == null) {
+            return null;
+        }
+        final IOAuthToken token = OAuthAccessTokenHolder.getInstance().getAccessToken(apiUrl, oAuthVersion);
+        return token instanceof OAuth20Token ? ((OAuth20Token) token).getBearerToken() : null;
+    }
+
+    /**
+     * Determines whether the user changed the access token in the advanced OAuth parameters.
+     * @return {@code true} if the access token entered differs from the one JOSM has
+     */
+    private boolean isAccessTokenEdited() {
+        final String current = getBearerToken();
+        return apiUrl != null && !pnlAdvancedProperties.getAccessToken().equals(current == null ? "" : current);
+    }
+
+    /**
+     * Get the access token entered in the advanced OAuth parameters: a token issued outside JOSM, pasted instead of
+     * authorizing JOSM. It works with nothing else, so it is a way to authenticate when authorizing JOSM is not
+     * possible.
+     * @return the token, or {@code null} if none is entered
+     */
+    private IOAuthToken getEnteredAccessToken() {
+        final String entered = pnlAdvancedProperties.getAccessToken();
+        return entered.isEmpty() ? null : OAuth20Token.fromAccessToken(pnlAdvancedProperties.getDisplayedParameters(), entered);
+    }
+
+    /**
+     * Takes over the access token entered in the advanced OAuth parameters, or removes the token if the field was
+     * cleared. This is done when the preferences are saved, so that cancelling them leaves the token as it was. A
+     * token which was not changed is left as it is, so that for example its refresh token is kept.
+     */
+    private void applyEnteredAccessToken() {
+        if (isAccessTokenEdited()) {
+            OAuthAccessTokenHolder.getInstance().setAccessToken(apiUrl, getEnteredAccessToken());
+        }
+    }
+
     /**
      * Sets the URL of the OSM API for which this panel is currently displaying OAuth properties.
      *
@@ -179,6 +210,7 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
      * Saves the current values to preferences
      */
     public void saveToPreferences() {
+        applyEnteredAccessToken();
         OAuthAccessTokenHolder.getInstance().setSaveToPreferences(cbSaveToPreferences.isSelected());
         OAuthAccessTokenHolder.getInstance().save(CredentialsManager.getInstance());
         OsmApi.USE_OAUTH_FOR_ALL_REQUESTS.put(cbUseForAllRequests.isSelected());
@@ -208,10 +240,7 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
             lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN));
 
             // Action for authorising now
-            add(new JButton(new AuthoriseNowAction(AuthorizationProcedure.FULLY_AUTOMATIC)), GBC.eol());
-            JButton authManually = new JButton(new AuthoriseNowAction(AuthorizationProcedure.MANUALLY));
-            add(authManually, GBC.eol());
-            ExpertToggleAction.addVisibilitySwitcher(authManually);
+            add(new JButton(new AuthoriseNowAction()), GBC.eol());
 
             // filler - grab remaining space
             add(new JPanel(), GBC.std().fill(GBC.BOTH));
@@ -223,7 +252,7 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
      *
      */
     private class AlreadyAuthorisedPanel extends JPanel {
-        private final JosmTextField tfAccessTokenKey = new JosmTextField(null, null, 0, false);
+        private final JPanel pnlButtons = new JPanel(new FlowLayout(FlowLayout.LEFT));
 
         /**
          * Constructs a new {@code AlreadyAuthorisedPanel}.
@@ -245,46 +274,26 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
             add(lbl, gc);
             lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN));
 
-            // -- access token key
+            // -- save to preferences; the Access Token itself is shown with the advanced OAuth parameters
             gc.gridy = 1;
             gc.gridx = 0;
-            gc.gridwidth = 1;
-            gc.weightx = 0.0;
-            add(new JLabel(tr("Access Token Key:")), gc);
-
-            gc.gridx = 1;
-            gc.weightx = 1.0;
-            add(tfAccessTokenKey, gc);
-            tfAccessTokenKey.setEditable(false);
-
-            // -- access token secret
-            gc.gridy = 2;
-            gc.gridx = 0;
-            gc.gridwidth = 1;
-            gc.weightx = 0.0;
-            add(new JLabel(tr("Access Token Secret:")), gc);
-
-            // -- access token secret
-            gc.gridy = 3;
-            gc.gridx = 0;
             gc.gridwidth = 2;
             gc.weightx = 1.0;
             add(cbSaveToPreferences, gc);
             cbSaveToPreferences.setSelected(OAuthAccessTokenHolder.getInstance().isSaveToPreferences());
 
             // -- action buttons
-            JPanel btns = new JPanel(new FlowLayout(FlowLayout.LEFT));
-            btns.add(new JButton(new RenewAuthorisationAction(AuthorizationProcedure.FULLY_AUTOMATIC)));
-            btns.add(new JButton(new TestAuthorisationAction()));
-            btns.add(new JButton(new RemoveAuthorisationAction()));
-            gc.gridy = 4;
+            pnlButtons.add(new JButton(new RenewAuthorisationAction()));
+            pnlButtons.add(new JButton(new TestAuthorisationAction()));
+            pnlButtons.add(new JButton(new RemoveAuthorisationAction()));
+            gc.gridy = 2;
             gc.gridx = 0;
             gc.gridwidth = 2;
             gc.weightx = 1.0;
-            add(btns, gc);
+            add(pnlButtons, gc);
 
             // filler - grab the remaining space
-            gc.gridy = 6;
+            gc.gridy = 3;
             gc.fill = GridBagConstraints.BOTH;
             gc.weightx = 1.0;
             gc.weighty = 1.0;
@@ -292,44 +301,31 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
         }
 
         protected final void refreshView() {
-            switch (oAuthVersion) {
-                case OAuth20:
-                case OAuth21:
-                    String token = "";
-                    if (apiUrl != null) {
-                        OAuth20Token bearerToken = (OAuth20Token) OAuthAccessTokenHolder.getInstance().getAccessToken(apiUrl, oAuthVersion);
-                        token = bearerToken == null ? "" : bearerToken.getBearerToken();
-                    }
-                    tfAccessTokenKey.setText(token == null ? "" : token);
-                    break;
-                default:
-            }
             cbSaveToPreferences.setSelected(OAuthAccessTokenHolder.getInstance().isSaveToPreferences());
         }
     }
 
     /**
-     * Action to authorise the current user
+     * Action to authorise the current user: JOSM is authorized in the web browser, with the OAuth parameters
+     * currently shown, and receives an Access Token by remote control.
      */
     private class AuthoriseNowAction extends AbstractAction {
-        private final AuthorizationProcedure procedure;
-
-        AuthoriseNowAction(AuthorizationProcedure procedure) {
-            this.procedure = procedure;
-            putValue(NAME, tr("{0} ({1})", tr("Authorize now"), procedure.getText()));
-            putValue(SHORT_DESCRIPTION, procedure.getDescription());
-            if (procedure == AuthorizationProcedure.FULLY_AUTOMATIC) {
-                new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
-            }
+        /** Counts the updates of the enabled state, so that the result of an earlier one cannot override a later one */
+        private int updates;
+
+        AuthoriseNowAction() {
+            putValue(NAME, tr("Authorize now"));
+            putValue(SHORT_DESCRIPTION, tr("Authorize JOSM in the web browser to access the OSM server on your behalf, "
+                    + "and get an Access Token"));
+            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
             updateEnabledState();
         }
 
         void updateEnabledState() {
-            if (procedure == AuthorizationProcedure.MANUALLY) {
-                this.setEnabled(true);
-            } else if (!pnlAdvancedProperties.isUseDefaultSettings()) {
+            final int update = ++updates;
+            if (!pnlAdvancedProperties.isUseDefaultSettings()) {
                 // The user supplied the parameters - the client id of an OAuth application they
-                // registered on the server themselves. The wizard is given exactly these parameters
+                // registered on the server themselves. Authorization uses exactly these parameters
                 // when the button is pressed, so they decide whether it can be pressed.
                 this.setEnabled(!Utils.isEmpty(pnlAdvancedProperties.getEnteredClientId()));
             } else if (Utils.isValidUrl(apiUrl)) {
@@ -341,13 +337,16 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
                     return;
                 }
                 if (DomainValidator.getInstance().isValid(apiURI.getHost())) {
-                    // We want to avoid trying to make connection with an invalid URL
+                    // We want to avoid trying to make connection with an invalid URL. These are the parameters
+                    // authorization uses, see AdvancedOAuthPropertiesPanel.getAdvancedParameters().
                     final String currentApiUrl = apiUrl;
                     MainApplication.worker.execute(() -> {
-                        final String clientId = OAuthParameters.createFromApiUrl(apiUrl, oAuthVersion).getClientId();
-                        if (Objects.equals(apiUrl, currentApiUrl)) {
-                            GuiHelper.runInEDT(() -> this.setEnabled(!Utils.isEmpty(clientId)));
-                        }
+                        final String clientId = OAuthParameters.createDefault(currentApiUrl, oAuthVersion).getClientId();
+                        GuiHelper.runInEDT(() -> {
+                            if (update == updates) {
+                                this.setEnabled(!Utils.isEmpty(clientId));
+                            }
+                        });
                     });
                 }
             }
@@ -355,22 +354,32 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
 
         @Override
         public void actionPerformed(ActionEvent arg0) {
-            OAuthAuthorizationWizard wizard = new OAuthAuthorizationWizard(
-                    OAuthAuthenticationPreferencesPanel.this,
-                    procedure,
-                    apiUrl,
-                    MainApplication.worker,
-                    oAuthVersion,
-                    pnlAdvancedProperties.getAdvancedParameters()
-                    );
-            try {
-                wizard.showDialog(token -> GuiHelper.runInEDT(OAuthAuthenticationPreferencesPanel.this::refreshView));
-            } catch (UserCancelException userCancelException) {
-                Logging.trace(userCancelException);
-                return;
+            final String currentApiUrl = apiUrl;
+            final IOAuthParameters parameters = pnlAdvancedProperties.getAdvancedParameters();
+            // the token is received by remote control, which is started for the time it takes if it is not running
+            final boolean remoteControlIsRunning = Boolean.TRUE.equals(RemoteControl.PROP_REMOTECONTROL_ENABLED.get());
+            if (!remoteControlIsRunning) {
+                RemoteControl.start();
             }
-            pnlAdvancedProperties.setAdvancedParameters(wizard.getOAuthParameters());
-            refreshView();
+            new OAuth20Authorization().authorize(parameters, token -> {
+                if (!remoteControlIsRunning) {
+                    RemoteControl.stop();
+                }
+                // a failed attempt, e.g. at a new token, leaves the token JOSM has as it is
+                token.ifPresent(t -> {
+                    OAuthAccessTokenHolder.getInstance().setAccessToken(currentApiUrl, t);
+                    OAuthAccessTokenHolder.getInstance().save(CredentialsManager.getInstance());
+                });
+                GuiHelper.runInEDT(() -> {
+                    if (!token.isPresent()) {
+                        JOptionPane.showMessageDialog(OAuthAuthenticationPreferencesPanel.this,
+                                tr("Authentication failed, please check browser for details."),
+                                tr("OAuth Authentication Failed"),
+                                JOptionPane.ERROR_MESSAGE);
+                    }
+                    refreshView();
+                });
+            }, OsmScopes.getJosmScopes());
         }
     }
 
@@ -393,17 +402,15 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
     }
 
     /**
-     * Launches the OAuthAuthorisationWizard to generate a new Access Token
+     * Authorizes JOSM again, to generate a new Access Token
      */
     private class RenewAuthorisationAction extends AuthoriseNowAction {
         /**
          * Constructs a new {@code RenewAuthorisationAction}.
          */
-        RenewAuthorisationAction(AuthorizationProcedure procedure) {
-            super(procedure);
+        RenewAuthorisationAction() {
             putValue(NAME, tr("New Access Token"));
             putValue(SHORT_DESCRIPTION, tr("Click to step through the OAuth authorization process and generate a new Access Token"));
-            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
         }
     }
 
@@ -422,7 +429,14 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
 
         @Override
         public void actionPerformed(ActionEvent evt) {
-            IOAuthToken token = OAuthAccessTokenHolder.getInstance().getAccessToken(apiUrl, OAuthVersion.OAuth20);
+            // a token pasted but not saved yet is what the user wants to know about, and none if the field was cleared
+            final IOAuthToken token = isAccessTokenEdited() ? getEnteredAccessToken()
+                    : OAuthAccessTokenHolder.getInstance().getAccessToken(apiUrl, oAuthVersion);
+            if (token == null) {
+                JOptionPane.showMessageDialog(OAuthAuthenticationPreferencesPanel.this,
+                        tr("There is no Access Token to test."), tr("Test Access Token"), JOptionPane.INFORMATION_MESSAGE);
+                return;
+            }
             TestAccessTokenTask task = new TestAccessTokenTask(
                     OAuthAuthenticationPreferencesPanel.this,
                     apiUrl,
@@ -436,8 +450,10 @@ public class OAuthAuthenticationPreferencesPanel extends JPanel implements Prope
     public void propertyChange(PropertyChangeEvent evt) {
         if (AdvancedOAuthPropertiesPanel.PARAMETERS_CHANGED_PROP.equals(evt.getPropertyName())) {
             updateAuthoriseNowActions();
+
         } else if (OsmApiUrlInputPanel.API_URL_PROP.equals(evt.getPropertyName())) {
             setApiUrl((String) evt.getNewValue());
+            refreshView();
         }
     }
 }
diff --git src/org/openstreetmap/josm/io/MissingOAuthAccessTokenException.java src/org/openstreetmap/josm/io/MissingOAuthAccessTokenException.java
index 44466f33ec..85a50a8021 100644
--- src/org/openstreetmap/josm/io/MissingOAuthAccessTokenException.java
+++ src/org/openstreetmap/josm/io/MissingOAuthAccessTokenException.java
@@ -6,11 +6,15 @@ package org.openstreetmap.josm.io;
  */
 public class MissingOAuthAccessTokenException extends OsmTransferException {
 
+    /** the API URL of the server JOSM has no OAuth client id for, so that it could not obtain an access token */
+    private final String clientIdMissingFor;
+
     /**
      * Constructs a new {@code MissingOAuthAccessTokenException}.
      */
     public MissingOAuthAccessTokenException() {
         super();
+        this.clientIdMissingFor = null;
     }
 
     /**
@@ -21,6 +25,7 @@ public class MissingOAuthAccessTokenException extends OsmTransferException {
      */
     public MissingOAuthAccessTokenException(String message, Throwable cause) {
         super(message, cause);
+        this.clientIdMissingFor = null;
     }
 
     /**
@@ -29,6 +34,12 @@ public class MissingOAuthAccessTokenException extends OsmTransferException {
      */
     public MissingOAuthAccessTokenException(String message) {
         super(message);
+        this.clientIdMissingFor = null;
+    }
+
+    private MissingOAuthAccessTokenException(String message, String clientIdMissingFor) {
+        super(message);
+        this.clientIdMissingFor = clientIdMissingFor;
     }
 
     /**
@@ -38,5 +49,35 @@ public class MissingOAuthAccessTokenException extends OsmTransferException {
      */
     public MissingOAuthAccessTokenException(Throwable cause) {
         super(cause);
+        this.clientIdMissingFor = null;
+    }
+
+    /**
+     * Creates the exception for a server JOSM has no OAuth client id for, so that it cannot obtain an access token:
+     * the user has to enter the client id of an OAuth application registered on the server, or an access token.
+     * @param apiUrl the API URL of the server
+     * @return the exception
+     * @since xxx
+     */
+    public static MissingOAuthAccessTokenException clientIdMissing(String apiUrl) {
+        return new MissingOAuthAccessTokenException("No OAuth client id for " + apiUrl + ", cannot request a token", apiUrl);
+    }
+
+    /**
+     * Determines whether JOSM has no OAuth client id for the server, which is why it has no access token.
+     * @return {@code true} if the client id is missing
+     * @since xxx
+     */
+    public boolean isClientIdMissing() {
+        return clientIdMissingFor != null;
+    }
+
+    /**
+     * Get the API URL of the server JOSM has no OAuth client id for.
+     * @return the API URL, or {@code null} unless {@link #isClientIdMissing()}
+     * @since xxx
+     */
+    public String getClientIdMissingFor() {
+        return clientIdMissingFor;
     }
 }
diff --git src/org/openstreetmap/josm/io/OsmConnection.java src/org/openstreetmap/josm/io/OsmConnection.java
index 184cf2272d..c369cb2432 100644
--- src/org/openstreetmap/josm/io/OsmConnection.java
+++ src/org/openstreetmap/josm/io/OsmConnection.java
@@ -3,9 +3,7 @@ package org.openstreetmap.josm.io;
 
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.lang.reflect.InvocationTargetException;
 import java.net.Authenticator.RequestorType;
-import java.net.URL;
 import java.nio.charset.StandardCharsets;
 import java.util.Base64;
 import java.util.Objects;
@@ -31,7 +29,6 @@ import org.openstreetmap.josm.io.auth.CredentialsAgentResponse;
 import org.openstreetmap.josm.io.auth.CredentialsManager;
 import org.openstreetmap.josm.io.remotecontrol.RemoteControl;
 import org.openstreetmap.josm.tools.HttpClient;
-import org.openstreetmap.josm.tools.JosmRuntimeException;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -49,34 +46,6 @@ public class OsmConnection {
     protected HttpClient activeConnection;
     protected IOAuthParameters oAuth20Parameters;
 
-    /**
-     * Retrieves OAuth access token.
-     * @since 12803
-     */
-    @FunctionalInterface
-    public interface OAuthAccessTokenFetcher {
-        /**
-         * Obtains an OAuth access token for the connection. Afterwards, the token is accessible via {@link OAuthAccessTokenHolder}.
-         * @param serverUrl the URL to OSM server
-         * @throws InterruptedException if we're interrupted while waiting for the event dispatching thread to finish OAuth authorization task
-         * @throws InvocationTargetException if an exception is thrown while running OAuth authorization task
-         */
-        void obtainAccessToken(URL serverUrl) throws InvocationTargetException, InterruptedException;
-    }
-
-    static volatile OAuthAccessTokenFetcher fetcher = u -> {
-        throw new JosmRuntimeException("OsmConnection.setOAuthAccessTokenFetcher() has not been called");
-    };
-
-    /**
-     * Sets the OAuth access token fetcher.
-     * @param tokenFetcher new OAuth access token fetcher. Cannot be null
-     * @since 12803
-     */
-    public static void setOAuthAccessTokenFetcher(OAuthAccessTokenFetcher tokenFetcher) {
-        fetcher = Objects.requireNonNull(tokenFetcher, "tokenFetcher");
-    }
-
     /**
      * Cancels the connection.
      */
@@ -149,11 +118,8 @@ public class OsmConnection {
     private void obtainOAuth20Token() throws MissingOAuthAccessTokenException {
         if (Utils.isEmpty(this.oAuth20Parameters.getClientId())) {
             // Without a client id the authorization request is rejected by the server with "Missing required
-            // parameter: client_id", so do not send the user to the browser at all. The message of the exception
-            // is for the log only; what the user is shown already points at the preferences, which is where the
-            // client id of an OAuth application registered on this server has to be entered.
-            throw new MissingOAuthAccessTokenException(
-                    "No OAuth client id for " + OsmApi.getOsmApi().getServerUrl() + ", cannot request a token");
+            // parameter: client_id", so do not send the user to the browser at all, but tell them what is missing.
+            throw MissingOAuthAccessTokenException.clientIdMissing(OsmApi.getOsmApi().getServerUrl());
         }
         if (!Boolean.TRUE.equals(GuiHelper.runInEDTAndWaitAndReturn(() ->
                 ConditionalOptionPaneUtil.showConfirmationDialog("oauth.oauth20.obtain.automatically",
@@ -179,23 +145,17 @@ public class OsmConnection {
                     done.countDown();
                 };
         new OAuth20Authorization().authorize(oAuth20Parameters,
-                consumer, OsmScopes.read_gpx, OsmScopes.write_gpx,
-                OsmScopes.read_prefs, OsmScopes.write_prefs,
-                OsmScopes.write_api, OsmScopes.write_notes);
-        // Only wait at most 5 minutes
-        int counter = 0;
-        while (done.getCount() >= 0 && counter < 5) {
-            try {
-                if (done.await(1, TimeUnit.MINUTES)) {
-                    break;
-                }
-            } catch (InterruptedException e) {
-                Thread.currentThread().interrupt();
-                Logging.trace(e);
-                consumer.accept(null);
-                throw new MissingOAuthAccessTokenException(e);
+                consumer, OsmScopes.getJosmScopes());
+        // Only wait at most 5 minutes for the user to authorize JOSM in the web browser
+        try {
+            if (!done.await(5, TimeUnit.MINUTES)) {
+                Logging.warn("No OAuth access token received from {0} within 5 minutes", OsmApi.getOsmApi().getServerUrl());
             }
-            counter++;
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            Logging.trace(e);
+            consumer.accept(Optional.empty());
+            throw new MissingOAuthAccessTokenException(e);
         }
     }
 
@@ -209,18 +169,18 @@ public class OsmConnection {
      */
     protected void addOAuth20AuthorizationHeader(HttpClient connection) throws OsmTransferException {
         if (this.oAuth20Parameters == null) {
-            // The parameters are stored under the API URL, so look them up with the API URL and not with the
-            // host of the request: OAuthParameters.createFromApiUrl() reduces it to the host itself where that
-            // is what it needs.
+            // Look them up with the API URL and not with the host of the request: OAuthParameters.createFromApiUrl()
+            // reduces it to the host itself for the stored parameters, and needs the URL for the default ones.
             this.oAuth20Parameters = OAuthParameters.createFromApiUrl(OsmApi.getOsmApi().getServerUrl(), OAuthVersion.OAuth20);
         }
         OAuthAccessTokenHolder holder = OAuthAccessTokenHolder.getInstance();
         IOAuthToken token = holder.getAccessToken(connection.getURL().toExternalForm(), OAuthVersion.OAuth20);
-        if (token == null) {
+        // A token is obtained for the API, and so is only found for requests to the host of the API
+        if (token == null && Objects.equals(connection.getURL().getHost(), OsmApi.getOsmApi().getHost())) {
             obtainOAuth20Token();
             token = holder.getAccessToken(connection.getURL().toExternalForm(), OAuthVersion.OAuth20);
         }
-        if (token == null) { // check if wizard completed
+        if (token == null) { // check if authorization completed
             throw new MissingOAuthAccessTokenException();
         }
         try {
diff --git src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java
index b23f2012e8..da46fa475a 100644
--- src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java
+++ src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java
@@ -132,24 +132,22 @@ public class JosmPreferencesCredentialAgent extends AbstractCredentialsAgent {
         if (accessToken == null) {
             Set<String> keySet = new HashSet<>(Config.getPref().getKeySet());
             keySet.addAll(Config.getPref().getSensitive()); // Just in case we decide to not return sensitive keys in getKeySet
-            // Assume we want to remove all access tokens
+            // Assume we want to remove all access tokens. The parameters stay: they are also the OAuth settings the
+            // user entered for the server, which are needed to obtain the next token.
             for (OAuthVersion oauthType : OAuthVersion.values()) {
                 final String hostKey = "oauth.access-token.object." + oauthType + "." + host;
-                final String parametersKey = "oauth.access-token.parameters." + oauthType + "." + host;
                 if (keySet.contains(hostKey)) {
                     Config.getPref().removeSensitive(hostKey);
                 }
-                if (keySet.contains(parametersKey)) {
-                    Config.getPref().removeSensitive(parametersKey);
-                }
             }
         } else {
             final String hostKey = "oauth.access-token.object." + accessToken.getOAuthType() + "." + host;
             final String parametersKey = "oauth.access-token.parameters." + accessToken.getOAuthType() + "." + host;
-            Config.getPref().put(hostKey, accessToken.toPreferencesString());
+            // the parameters first: listeners of the token, like UserIdentityManager, find them in place
             Config.getPref().put(parametersKey, accessToken.getParameters().toPreferencesString());
-            Config.getPref().addSensitive(this, hostKey);
             Config.getPref().addSensitive(this, parametersKey);
+            Config.getPref().put(hostKey, accessToken.toPreferencesString());
+            Config.getPref().addSensitive(this, hostKey);
         }
     }
 
diff --git src/org/openstreetmap/josm/tools/ExceptionUtil.java src/org/openstreetmap/josm/tools/ExceptionUtil.java
index 34711a93b0..acac60d06a 100644
--- src/org/openstreetmap/josm/tools/ExceptionUtil.java
+++ src/org/openstreetmap/josm/tools/ExceptionUtil.java
@@ -83,6 +83,16 @@ public final class ExceptionUtil {
      */
     public static String explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e) {
         Logging.error(e);
+        if (e.isClientIdMissing()) {
+            return tr(
+                    "<html>Failed to authenticate at the OSM server ''{0}''.<br>"
+                    + "JOSM cannot obtain an OAuth Access Token for this server, because it has no OAuth Client ID for it.<br>"
+                    + "Please register an OAuth 2.0 application on the server, and enter its Client ID in the OAuth<br>"
+                    + "settings of the Preferences Dialog; or enter an Access Token obtained outside JOSM there."
+                    + "</html>",
+                    e.getClientIdMissingFor()
+            );
+        }
         return tr(
                 "<html>Failed to authenticate at the OSM server ''{0}''.<br>"
                 + "You are using OAuth to authenticate but currently there is no<br>"
diff --git test/unit/org/openstreetmap/josm/data/PreferencesTest.java test/unit/org/openstreetmap/josm/data/PreferencesTest.java
index 0ffb4d152f..9a10a59a99 100644
--- test/unit/org/openstreetmap/josm/data/PreferencesTest.java
+++ test/unit/org/openstreetmap/josm/data/PreferencesTest.java
@@ -2,10 +2,22 @@
 package org.openstreetmap.josm.data;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+import javax.xml.stream.XMLStreamException;
 
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+import org.openstreetmap.josm.spi.preferences.IBaseDirectories;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.testutils.annotations.OsmApi;
+import org.xml.sax.SAXException;
 
 /**
  * Unit tests of {@link Preferences}.
@@ -25,4 +37,45 @@ class PreferencesTest {
             "</preferences>%n", Version.getInstance().getVersion()),
                 Preferences.main().toXML(true));
     }
+
+    /**
+     * The OAuth 1.0a access token, which nothing has used since OAuth 1.0a was removed, is deleted from the
+     * preferences when they are loaded, so that it does not stay on disk indefinitely.
+     * @param dir a temporary directory for the preferences file
+     * @throws IOException if the preferences file cannot be written or read
+     * @throws SAXException if the preferences file is not valid
+     * @throws XMLStreamException if the preferences file cannot be parsed
+     */
+    @Test
+    void testObsoleteOAuth10aTokenIsRemoved(@TempDir Path dir) throws IOException, SAXException, XMLStreamException {
+        Files.write(dir.resolve("preferences.xml"), String.format(
+            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>%n" +
+            "<preferences xmlns='http://josm.openstreetmap.de/preferences-1.0' version='19000'>%n" +
+            "  <tag key='oauth.access-token.key' value='an-old-key'/>%n" +
+            "  <tag key='oauth.access-token.secret' value='an-old-secret'/>%n" +
+            "  <tag key='osm-server.url' value='http://fake.xxx/api'/>%n" +
+            "</preferences>%n").getBytes(StandardCharsets.UTF_8));
+        final File directory = dir.toFile();
+        final Preferences preferences = new Preferences(new IBaseDirectories() {
+            @Override
+            public File getPreferencesDirectory(boolean createIfMissing) {
+                return directory;
+            }
+
+            @Override
+            public File getUserDataDirectory(boolean createIfMissing) {
+                return directory;
+            }
+
+            @Override
+            public File getCacheDirectory(boolean createIfMissing) {
+                return directory;
+            }
+        });
+        preferences.load();
+
+        assertNull(preferences.get("oauth.access-token.key", null));
+        assertNull(preferences.get("oauth.access-token.secret", null));
+        assertEquals("http://fake.xxx/api", preferences.get("osm-server.url", null));
+    }
 }
diff --git test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java
index 4bb4d5fd39..b5003be1a8 100644
--- test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java
+++ test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java
@@ -13,8 +13,15 @@ import static org.junit.jupiter.api.Assertions.fail;
 import java.util.function.Function;
 import java.util.stream.Stream;
 
+import org.openstreetmap.josm.data.oauth.OAuth20Parameters;
+import org.openstreetmap.josm.data.oauth.OAuth20Token;
+import org.openstreetmap.josm.data.oauth.OAuthAccessTokenHolder;
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.data.osm.UserInfo;
+import org.openstreetmap.josm.io.NetworkManager;
+import org.openstreetmap.josm.io.OnlineResource;
+import org.openstreetmap.josm.io.OsmApi;
+import org.openstreetmap.josm.io.auth.CredentialsManager;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
@@ -40,6 +47,40 @@ class UserIdentityManagerTest {
         return userInfo;
     }
 
+    /**
+     * Removing the OAuth token of the server makes the user anonymous.
+     * <p>
+     * Non-regression test: the identity followed the parameters stored with the token, which are kept since they
+     * are the OAuth settings of the server too, so the user stayed identified after "Remove token".
+     * @throws Exception if the token cannot be stored
+     */
+    @Test
+    void testRemovingTheOAuthTokenMakesTheUserAnonymous() throws Exception {
+        // fetching the user details once a token is stored must not make a network request
+        NetworkManager.setOffline(OnlineResource.ALL);
+        Config.getPref().put("osm-server.auth-method", "oauth20");
+        final String apiUrl = OsmApi.getOsmApi().getServerUrl();
+        final String host = OsmApi.getOsmApi().getHost();
+        try {
+            OAuthAccessTokenHolder.getInstance().clear();
+            CredentialsManager.getInstance().storeOAuthAccessToken(host, new OAuth20Token(
+                    new OAuth20Parameters("", null, "", "", apiUrl, ""), "{\"access_token\": \"a-token\", \"token_type\": \"bearer\"}"));
+            UserIdentityManager.getInstance().setPartiallyIdentified("a-user");
+
+            // what "Remove token" in the preferences does
+            OAuthAccessTokenHolder.getInstance().setAccessToken(apiUrl, null);
+            OAuthAccessTokenHolder.getInstance().save(CredentialsManager.getInstance());
+
+            assertTrue(UserIdentityManager.getInstance().isAnonymous());
+        } finally {
+            Config.getPref().removeSensitive("oauth.access-token.parameters.OAuth20." + host);
+            Config.getPref().put("osm-server.auth-method", null);
+            OAuthAccessTokenHolder.getInstance().clear();
+            NetworkManager.setOnline(OnlineResource.ALL);
+            UserIdentityManager.getInstance().setAnonymous();
+        }
+    }
+
     /**
      * Test singleton access.
      */
diff --git test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java
index 24ab07f7fd..cff76a9eef 100644
--- test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java
+++ test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java
@@ -2,8 +2,11 @@
 package org.openstreetmap.josm.data.oauth;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
@@ -14,6 +17,10 @@ import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.tools.Logging;
 
+import com.github.tomakehurst.wiremock.WireMockServer;
+import com.github.tomakehurst.wiremock.client.WireMock;
+import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
+
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import nl.jqno.equalsverifier.EqualsVerifier;
 
@@ -23,11 +30,29 @@ import nl.jqno.equalsverifier.EqualsVerifier;
 @BasicPreferences
 class OAuthParametersTest {
 
+    private static final String THIRD_PARTY = "https://nonprod-mapops.example.org/api";
+    private static final String THIRD_PARTY_HOST = "nonprod-mapops.example.org";
+    private static final String OHM = "https://api.openhistoricalmap.org/api";
+    private static final String REDIRECT_URI = "http://127.0.0.1:8111/oauth_authorization";
+
     @AfterEach
     void tearDown() {
         NetworkManager.setOnline(OnlineResource.ALL);
-        // the API URL is static state shared with the other tests of this class
+        // the preferences are static state shared with the other tests of this class
         Config.getPref().put("osm-server.url", null);
+        for (String key : new String[] {THIRD_PARTY_HOST, THIRD_PARTY, "api.openhistoricalmap.org"}) {
+            Config.getPref().put("oauth.access-token.parameters.OAuth20." + key, null);
+            Config.getPref().put("oauth.settings.use-default." + key, null);
+        }
+        Config.getPref().put("oauth.settings.use-default", null);
+    }
+
+    private static OAuth20Parameters enteredParameters(String apiUrl, String clientId) {
+        return new OAuth20Parameters(clientId, null, apiUrl, apiUrl, REDIRECT_URI);
+    }
+
+    private static String clientIdOf(String apiUrl) {
+        return OAuthParameters.createFromApiUrl(apiUrl, OAuthVersion.OAuth20).getClientId();
     }
 
     /**
@@ -51,8 +76,9 @@ class OAuthParametersTest {
         // a server JOSM knows nothing about has no client id until the user enters one
         assertEquals("", OAuthParameters.createFromApiUrl(thirdParty, OAuthVersion.OAuth20).getClientId());
 
-        // once the parameters are remembered - as the authentication preferences do, under the API URL - they
-        // are found both by the API URL and by the host, which is what a connection has at hand
+        // once the parameters are remembered - as the authentication preferences do - they are found both by the
+        // API URL and by the host, which is what a connection has at hand
+        OAuthParameters.setUseDefault(thirdParty, false);
         new OAuth20Parameters("entered-client-id", null, thirdParty, thirdParty, "http://127.0.0.1:8111/oauth_authorization")
                 .rememberPreferences();
         assertEquals("entered-client-id",
@@ -61,6 +87,121 @@ class OAuthParametersTest {
                 OAuthParameters.createFromApiUrl("https://api.openhistoricalmap.org/api", OAuthVersion.OAuth20).getApiUrl());
     }
 
+    /**
+     * The parameters the user entered are stored under the host of the API, which is where the access token of the
+     * server is stored too, and replace those stored under the API URL by earlier versions of JOSM.
+     */
+    @Test
+    void testParametersAreStoredUnderTheHost() {
+        NetworkManager.setOffline(OnlineResource.ALL);
+        OAuthParameters.setUseDefault(THIRD_PARTY, false);
+        // as stored by earlier versions of JOSM, which are still found
+        Config.getPref().put("oauth.access-token.parameters.OAuth20." + THIRD_PARTY,
+                enteredParameters(THIRD_PARTY, "old-client-id").toPreferencesString());
+        assertEquals("old-client-id", clientIdOf(THIRD_PARTY));
+
+        enteredParameters(THIRD_PARTY, "new-client-id").rememberPreferences();
+        assertNotNull(Config.getPref().get("oauth.access-token.parameters.OAuth20." + THIRD_PARTY_HOST, null));
+        assertNull(Config.getPref().get("oauth.access-token.parameters.OAuth20." + THIRD_PARTY, null),
+                "the parameters stored by earlier versions of JOSM are left behind");
+        assertEquals("new-client-id", clientIdOf(THIRD_PARTY));
+        assertEquals("new-client-id", clientIdOf(THIRD_PARTY_HOST));
+    }
+
+    /**
+     * "Use default settings" is a setting of each server: entering the client id of one server does not take the
+     * client ids JOSM has for the other servers away, and the entered parameters are not used once the server is set
+     * to use the default settings again, but stay for when they are needed again.
+     */
+    @Test
+    void testUseDefaultIsASettingOfEachServer() {
+        NetworkManager.setOffline(OnlineResource.ALL);
+        assertTrue(OAuthParameters.isUseDefault(THIRD_PARTY));
+        OAuthParameters.setUseDefault(THIRD_PARTY, false);
+        enteredParameters(THIRD_PARTY, "entered-client-id").rememberPreferences();
+        enteredParameters(OHM, "not-used").rememberPreferences();
+
+        assertFalse(OAuthParameters.isUseDefault(THIRD_PARTY));
+        assertFalse(OAuthParameters.isUseDefault(THIRD_PARTY_HOST));
+        assertTrue(OAuthParameters.isUseDefault(OHM));
+        assertEquals("entered-client-id", clientIdOf(THIRD_PARTY));
+        assertEquals("Hl5yIhFS-Egj6aY7A35ouLOuZl0EHjj8JJQQ46IO96E", clientIdOf(OHM));
+
+        OAuthParameters.setUseDefault(THIRD_PARTY, true);
+        assertEquals("", clientIdOf(THIRD_PARTY));
+        OAuthParameters.setUseDefault(THIRD_PARTY, false);
+        assertEquals("entered-client-id", clientIdOf(THIRD_PARTY));
+    }
+
+    /**
+     * Until a server has a "use default settings" of its own, the setting earlier versions of JOSM had for all
+     * servers applies, so that the parameters entered with them are still used.
+     */
+    @Test
+    void testUseDefaultFallsBackToTheSettingForAllServers() {
+        Config.getPref().putBoolean("oauth.settings.use-default", false);
+        assertFalse(OAuthParameters.isUseDefault(THIRD_PARTY));
+        OAuthParameters.setUseDefault(THIRD_PARTY, true);
+        assertTrue(OAuthParameters.isUseDefault(THIRD_PARTY));
+        assertFalse(OAuthParameters.isUseDefault(OHM));
+    }
+
+    /**
+     * The OAuth settings of a server are stored under its host, whether it is given as the API URL or as the host,
+     * and a missing API URL does not throw.
+     */
+    @Test
+    void testGetHost() {
+        assertEquals(THIRD_PARTY_HOST, OAuthParameters.getHost(THIRD_PARTY));
+        assertEquals(THIRD_PARTY_HOST, OAuthParameters.getHost(THIRD_PARTY_HOST));
+        assertEquals("localhost", OAuthParameters.getHost("http://localhost:3000/api"));
+        assertNull(OAuthParameters.getHost(null));
+        assertTrue(OAuthParameters.isUseDefault(null));
+        OAuthParameters.setUseDefault(null, false);
+        assertTrue(OAuthParameters.isUseDefault(null));
+        // parameters without a server are not stored under a key without a host
+        new OAuth20Parameters("a-client-id", null, "", "", "", REDIRECT_URI).rememberPreferences();
+        assertNull(Config.getPref().get("oauth.access-token.parameters.OAuth20.", null));
+    }
+
+    /**
+     * When the server does not publish its OAuth metadata, the endpoints are those of openstreetmap-website, on the
+     * website rather than below the API URL: {@code <api url>/authorize} is wrong for every OSM API server.
+     */
+    @Test
+    void testEndpointsWithoutDiscovery() {
+        NetworkManager.setOffline(OnlineResource.ALL);
+        final IOAuthParameters thirdParty = OAuthParameters.createDefault(THIRD_PARTY, OAuthVersion.OAuth20);
+        assertEquals("https://nonprod-mapops.example.org/oauth2/authorize", thirdParty.getAuthorizationUrl());
+        assertEquals("https://nonprod-mapops.example.org/oauth2/token", thirdParty.getAccessTokenUrl());
+        assertEquals(THIRD_PARTY, thirdParty.getApiUrl());
+        // the default API is served from a host of its own
+        final IOAuthParameters osm = OAuthParameters.createDefault("https://api.openstreetmap.org/api", OAuthVersion.OAuth20);
+        assertEquals("https://www.openstreetmap.org/oauth2/authorize", osm.getAuthorizationUrl());
+        assertEquals("https://www.openstreetmap.org/oauth2/token", osm.getAccessTokenUrl());
+    }
+
+    /**
+     * The OAuth metadata (RFC 8414) of a server is looked up on its port, such as that of a development server on
+     * http://localhost:3000. Non-regression test: the port was dropped, so the metadata was not found.
+     */
+    @Test
+    void testDiscoveryUsesThePort() {
+        final WireMockServer server = new WireMockServer(WireMockConfiguration.options().dynamicPort());
+        server.start();
+        try {
+            final String website = "http://localhost:" + server.port();
+            server.stubFor(WireMock.get(WireMock.urlEqualTo("/.well-known/oauth-authorization-server")).willReturn(WireMock.okJson(
+                    "{\"authorization_endpoint\": \"" + website + "/discovered/authorize\","
+                    + " \"token_endpoint\": \"" + website + "/discovered/token\"}")));
+            final IOAuthParameters parameters = OAuthParameters.createDefault(website + "/api", OAuthVersion.OAuth20);
+            assertEquals(website + "/discovered/authorize", parameters.getAuthorizationUrl());
+            assertEquals(website + "/discovered/token", parameters.getAccessTokenUrl());
+        } finally {
+            server.stop();
+        }
+    }
+
     /**
      * Unit test of method {@link OAuthParameters#createDefault}.
      */
diff --git test/unit/org/openstreetmap/josm/data/oauth/OsmPrivilegesTest.java test/unit/org/openstreetmap/josm/data/oauth/OsmPrivilegesTest.java
deleted file mode 100644
index c723338baa..0000000000
--- test/unit/org/openstreetmap/josm/data/oauth/OsmPrivilegesTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.data.oauth;
-
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import org.junit.jupiter.api.Test;
-
-/**
- * Unit tests for class {@link OsmPrivileges}.
- */
-class OsmPrivilegesTest {
-
-    /**
-     * Unit test of getters/setters.
-     */
-    @Test
-    void testGettersSetters() {
-        OsmPrivileges p = new OsmPrivileges();
-        assertFalse(p.isAllowModifyNotes());
-        assertFalse(p.isAllowReadGpx());
-        assertFalse(p.isAllowReadPrefs());
-        assertFalse(p.isAllowWriteApi());
-        assertFalse(p.isAllowWriteGpx());
-        assertFalse(p.isAllowWritePrefs());
-        p.setAllowModifyNotes(true);
-        assertTrue(p.isAllowModifyNotes());
-        p.setAllowReadGpx(true);
-        assertTrue(p.isAllowReadGpx());
-        p.setAllowReadPrefs(true);
-        assertTrue(p.isAllowReadPrefs());
-        p.setAllowWriteApi(true);
-        assertTrue(p.isAllowWriteApi());
-        p.setAllowWriteGpx(true);
-        assertTrue(p.isAllowWriteGpx());
-        p.setAllowWritePrefs(true);
-        assertTrue(p.isAllowWritePrefs());
-    }
-}
diff --git test/unit/org/openstreetmap/josm/gui/ExceptionDialogUtilTest.java test/unit/org/openstreetmap/josm/gui/ExceptionDialogUtilTest.java
index 6f10a93c20..eff627b27a 100644
--- test/unit/org/openstreetmap/josm/gui/ExceptionDialogUtilTest.java
+++ test/unit/org/openstreetmap/josm/gui/ExceptionDialogUtilTest.java
@@ -1,13 +1,29 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.Collections;
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import org.junit.jupiter.api.Test;
+import org.openstreetmap.josm.TestUtils;
+import org.openstreetmap.josm.actions.PreferencesAction;
+import org.openstreetmap.josm.io.MissingOAuthAccessTokenException;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker;
+import org.openstreetmap.josm.tools.ExceptionUtil;
 
+import mockit.Mock;
+import mockit.MockUp;
 import net.trajano.commons.testing.UtilityClassTestUtil;
 
 /**
  * Unit tests of {@link ExceptionDialogUtil} class.
  */
+@BasicPreferences
 class ExceptionDialogUtilTest {
     /**
      * Tests that {@code ExceptionDialogUtil} satisfies utility class criteria.
@@ -17,4 +33,37 @@ class ExceptionDialogUtilTest {
     void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(ExceptionDialogUtil.class);
     }
+
+    /**
+     * Without an OAuth Access Token the user is offered to open the preferences, where JOSM is authorized or the
+     * client id or a token is entered.
+     */
+    @Test
+    void testMissingOAuthAccessTokenOffersThePreferences() {
+        assertEquals(1, explainMissingOAuthAccessToken("Open preferences"));
+        assertEquals(0, explainMissingOAuthAccessToken("Close"));
+    }
+
+    private static int explainMissingOAuthAccessToken(String answer) {
+        TestUtils.assumeWorkingJMockit();
+        final MissingOAuthAccessTokenException e = MissingOAuthAccessTokenException.clientIdMissing("https://example.org/api");
+        final HelpAwareOptionPaneMocker mocker = new HelpAwareOptionPaneMocker(
+                Collections.singletonMap(ExceptionUtil.explainMissingOAuthAccessTokenException(e), answer));
+        final AtomicBoolean opened = new AtomicBoolean();
+        new MockUp<PreferencesAction>() {
+            @Mock
+            public void run() {
+                opened.set(true);
+            }
+        };
+        ExceptionDialogUtil.explainMissingOAuthAccessTokenException(e);
+        assertEquals(1, mocker.getInvocationLog().size());
+        assertEquals("Authentication failed", mocker.getInvocationLog().get(0)[2]);
+        if (opened.get()) {
+            assertTrue(answer.startsWith("Open"));
+            return 1;
+        }
+        assertFalse(answer.startsWith("Open"));
+        return 0;
+    }
 }
diff --git test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java
index 8ce5e668b9..f4b7e43c6e 100644
--- test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java
+++ test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java
@@ -7,7 +7,6 @@ import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.GraphicsEnvironment;
-import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -17,16 +16,10 @@ import javax.swing.JPanel;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.UserIdentityManager;
-import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.testutils.annotations.OsmApi;
 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
 import org.openstreetmap.josm.testutils.mockers.WindowMocker;
-import org.openstreetmap.josm.tools.UserCancelException;
-
-import mockit.Invocation;
-import mockit.Mock;
-import mockit.MockUp;
 
 /**
  * Unit tests of {@link DownloadOpenChangesetsTask} class.
@@ -34,33 +27,6 @@ import mockit.MockUp;
 @BasicPreferences
 @OsmApi(OsmApi.APIType.DEV)
 class DownloadOpenChangesetsTaskTest {
-    /**
-     * OAuth wizard mocker.
-     */
-    public static class OAuthWizardMocker extends MockUp<OAuthAuthorizationWizard> {
-        /** {@code true} if wizard has been called */
-        public boolean called;
-
-        @Mock
-        void showDialog() throws UserCancelException {
-            this.called = true;
-            throw new UserCancelException();
-        }
-
-        @Mock
-        void obtainAccessToken(final Invocation invocation, final URL serverUrl) {
-            if (GraphicsEnvironment.isHeadless()) {
-                // we can't really let execution proceed any further as construction of the ui
-                // elements will fail with a mocked Window
-                this.called = true;
-                return;
-            }
-            // else we can allow a bit more of the code to be covered before we raise
-            // UserCancelException in showDialog
-            invocation.proceed(serverUrl);
-        }
-    }
-
     /**
      * Test of {@link DownloadOpenChangesetsTask} class when anonymous.
      */
diff --git test/unit/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanelTest.java test/unit/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanelTest.java
new file mode 100644
index 0000000000..dc2a6daae4
--- /dev/null
+++ test/unit/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanelTest.java
@@ -0,0 +1,210 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.oauth;
+
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.awt.Component;
+import java.lang.reflect.Field;
+import java.util.concurrent.ExecutionException;
+
+import javax.swing.JCheckBox;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JTextField;
+
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.openstreetmap.josm.data.oauth.IOAuthParameters;
+import org.openstreetmap.josm.data.oauth.OAuth20Parameters;
+import org.openstreetmap.josm.data.oauth.OAuthParameters;
+import org.openstreetmap.josm.data.oauth.OAuthVersion;
+import org.openstreetmap.josm.data.oauth.osm.OsmScopes;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
+import org.openstreetmap.josm.io.NetworkManager;
+import org.openstreetmap.josm.io.OnlineResource;
+import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.tools.ReflectionUtils;
+
+/**
+ * Unit tests of {@link AdvancedOAuthPropertiesPanel}.
+ */
+@BasicPreferences
+class AdvancedOAuthPropertiesPanelTest {
+    private static final String THIRD_PARTY = "https://nonprod-mapops.example.org/api";
+    private static final String THIRD_PARTY_HOST = "nonprod-mapops.example.org";
+    private static final String OHM = "https://api.openhistoricalmap.org/api";
+    private static final String OHM_HOST = "api.openhistoricalmap.org";
+
+    @BeforeEach
+    void setUp() {
+        // the default parameters would otherwise be looked up with an RFC 8414 request
+        NetworkManager.setOffline(OnlineResource.ALL);
+    }
+
+    @AfterEach
+    void tearDown() {
+        NetworkManager.setOnline(OnlineResource.ALL);
+        // the preferences are static state shared with the other tests of this class
+        for (String host : new String[] {THIRD_PARTY_HOST, OHM_HOST}) {
+            Config.getPref().put("oauth.access-token.parameters.OAuth20." + host, null);
+            Config.getPref().put("oauth.settings.use-default." + host, null);
+        }
+    }
+
+    private static void waitForWorkerAndEdt() throws ExecutionException, InterruptedException {
+        MainApplication.worker.submit(() -> { }).get();
+        GuiHelper.runInEDTAndWait(() -> { });
+    }
+
+    /**
+     * Each server has OAuth settings of its own: the panel shows those of the server whose API URL it is given,
+     * and saves them for that server only.
+     * @throws ExecutionException if waiting for the worker fails
+     * @throws InterruptedException if waiting for the worker is interrupted
+     */
+    @Test
+    void testSettingsFollowTheServer() throws ExecutionException, InterruptedException {
+        OAuthParameters.setUseDefault(THIRD_PARTY, false);
+        new OAuth20Parameters("entered-client-id", null, THIRD_PARTY, THIRD_PARTY, "http://127.0.0.1:8111/oauth_authorization")
+                .rememberPreferences();
+        final String entered = Config.getPref().get("oauth.access-token.parameters.OAuth20." + THIRD_PARTY_HOST, null);
+
+        final AdvancedOAuthPropertiesPanel panel = new AdvancedOAuthPropertiesPanel(OAuthVersion.OAuth20);
+        panel.initialize(THIRD_PARTY);
+        waitForWorkerAndEdt();
+        assertFalse(panel.isUseDefaultSettings());
+        assertEquals("entered-client-id", panel.getEnteredClientId());
+
+        panel.setApiUrl(OHM);
+        waitForWorkerAndEdt();
+        assertTrue(panel.isUseDefaultSettings(), "the settings of the other server were kept");
+        assertEquals("Hl5yIhFS-Egj6aY7A35ouLOuZl0EHjj8JJQQ46IO96E", panel.getEnteredClientId());
+        panel.rememberPreferences();
+        assertTrue(OAuthParameters.isUseDefault(OHM));
+        assertFalse(OAuthParameters.isUseDefault(THIRD_PARTY), "saved for another server");
+        assertEquals(entered, Config.getPref().get("oauth.access-token.parameters.OAuth20." + THIRD_PARTY_HOST, null));
+
+        panel.setApiUrl(THIRD_PARTY);
+        waitForWorkerAndEdt();
+        assertFalse(panel.isUseDefaultSettings());
+        assertEquals("entered-client-id", panel.getEnteredClientId());
+    }
+
+    /**
+     * The OAuth parameters are shown when the user enters them, that is when the default settings are not used.
+     * The access token is not one of them: it can be pasted whichever settings are used.
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     * @throws ExecutionException if waiting for the worker fails
+     * @throws InterruptedException if waiting for the worker is interrupted
+     */
+    @Test
+    void testParametersAreShownWhenEntered() throws ReflectiveOperationException, ExecutionException, InterruptedException {
+        final AdvancedOAuthPropertiesPanel panel = new AdvancedOAuthPropertiesPanel(OAuthVersion.OAuth20);
+        panel.initialize(THIRD_PARTY);
+        waitForWorkerAndEdt();
+        final JComponent clientId = getField(panel, "tfClientId");
+        final JComponent accessToken = getField(panel, "tfAccessToken");
+        assertTrue(panel.isUseDefaultSettings());
+        assertFalse(clientId.isVisible());
+        assertTrue(accessToken.isVisible());
+
+        ((JCheckBox) getField(panel, "cbUseDefaults")).setSelected(false);
+        assertTrue(clientId.isVisible());
+        assertTrue(accessToken.isVisible());
+
+        OAuthParameters.setUseDefault(THIRD_PARTY, false);
+        final AdvancedOAuthPropertiesPanel entered = new AdvancedOAuthPropertiesPanel(OAuthVersion.OAuth20);
+        entered.initialize(THIRD_PARTY);
+        assertTrue(((JComponent) getField(entered, "tfClientId")).isVisible(), "the parameters are entered for this server");
+    }
+
+    /**
+     * Each field explains what it holds, and so does its label; the client id and the access token list the
+     * permissions JOSM needs, which the application has to be registered with.
+     */
+    @Test
+    void testToolTips() {
+        final AdvancedOAuthPropertiesPanel panel = new AdvancedOAuthPropertiesPanel(OAuthVersion.OAuth20);
+        int labels = 0;
+        for (Component c : panel.getComponents()) {
+            if (c instanceof JosmTextField || c instanceof JCheckBox) {
+                assertNotNull(((JComponent) c).getToolTipText(), c::toString);
+            } else if (c instanceof JLabel) {
+                final JComponent field = (JComponent) ((JLabel) c).getLabelFor();
+                assertNotNull(field, ((JLabel) c)::getText);
+                assertEquals(field.getToolTipText(), ((JLabel) c).getToolTipText());
+                labels++;
+            }
+        }
+        assertEquals(6, labels);
+        for (String name : new String[] {"tfClientId", "tfAccessToken"}) {
+            final String toolTip = assertDoesNotThrow(() -> getField(panel, name)).getToolTipText();
+            for (OsmScopes scope : OsmScopes.getJosmScopes()) {
+                assertTrue(toolTip.contains(scope.name()), () -> name + " does not list " + scope + ": " + toolTip);
+            }
+        }
+    }
+
+    /**
+     * White space copied along with the values does not become part of them. Non-regression test: a client secret
+     * pasted with a trailing space was sent as it was, and the server refused the token request with
+     * "invalid_client".
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     * @throws ExecutionException if waiting for the worker fails
+     * @throws InterruptedException if waiting for the worker is interrupted
+     */
+    @Test
+    void testEnteredValuesAreTrimmed() throws ReflectiveOperationException, ExecutionException, InterruptedException {
+        final AdvancedOAuthPropertiesPanel panel = new AdvancedOAuthPropertiesPanel(OAuthVersion.OAuth20);
+        panel.initialize(THIRD_PARTY);
+        waitForWorkerAndEdt();
+        ((JCheckBox) getField(panel, "cbUseDefaults")).setSelected(false);
+        ((JTextField) getField(panel, "tfClientId")).setText(" a-client-id\t");
+        ((JTextField) getField(panel, "tfClientSecret")).setText("a-client-secret ");
+        ((JTextField) getField(panel, "tfRedirectUri")).setText(" http://127.0.0.1:8111/oauth_authorization");
+        ((JTextField) getField(panel, "tfAccessTokenURL")).setText("https://nonprod-mapops.example.org/oauth2/token\n");
+        ((JTextField) getField(panel, "tfAuthoriseURL")).setText("  https://nonprod-mapops.example.org/oauth2/authorize");
+
+        final IOAuthParameters parameters = panel.getAdvancedParameters();
+        assertEquals("a-client-id", parameters.getClientId());
+        assertEquals("a-client-secret", parameters.getClientSecret());
+        assertEquals("http://127.0.0.1:8111/oauth_authorization", parameters.getRedirectUri());
+        assertEquals("https://nonprod-mapops.example.org/oauth2/token", parameters.getAccessTokenUrl());
+        assertEquals("https://nonprod-mapops.example.org/oauth2/authorize", parameters.getAuthorizationUrl());
+        assertEquals("a-client-id", panel.getEnteredClientId());
+    }
+
+    private static JComponent getField(AdvancedOAuthPropertiesPanel panel, String name) throws ReflectiveOperationException {
+        final Field field = AdvancedOAuthPropertiesPanel.class.getDeclaredField(name);
+        ReflectionUtils.setObjectsAccessible(field);
+        return (JComponent) field.get(panel);
+    }
+
+    /**
+     * Saving with "use default settings" ticked keeps the settings entered earlier, for when they are needed again.
+     * @throws ExecutionException if waiting for the worker fails
+     * @throws InterruptedException if waiting for the worker is interrupted
+     */
+    @Test
+    void testUseDefaultKeepsTheEnteredSettings() throws ExecutionException, InterruptedException {
+        new OAuth20Parameters("entered-client-id", null, THIRD_PARTY, THIRD_PARTY, "http://127.0.0.1:8111/oauth_authorization")
+                .rememberPreferences();
+        final AdvancedOAuthPropertiesPanel panel = new AdvancedOAuthPropertiesPanel(OAuthVersion.OAuth20);
+        panel.initialize(THIRD_PARTY);
+        waitForWorkerAndEdt();
+        assertTrue(panel.isUseDefaultSettings());
+        panel.rememberPreferences();
+        waitForWorkerAndEdt();
+
+        OAuthParameters.setUseDefault(THIRD_PARTY, false);
+        assertEquals("entered-client-id", OAuthParameters.createFromApiUrl(THIRD_PARTY, OAuthVersion.OAuth20).getClientId());
+    }
+}
diff --git test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java
deleted file mode 100644
index 4194c3e830..0000000000
--- test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java
+++ /dev/null
@@ -1,25 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.oauth;
-
-import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
-
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.EnumSource;
-import org.openstreetmap.josm.data.oauth.OAuthVersion;
-import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
-
-/**
- * Unit tests of {@link FullyAutomaticAuthorizationUI} class.
- */
-@BasicPreferences
-class FullyAutomaticAuthorizationUITest {
-    /**
-     * Unit test of {@link FullyAutomaticAuthorizationUI#FullyAutomaticAuthorizationUI}.
-     */
-    @ParameterizedTest
-    @EnumSource(OAuthVersion.class)
-    void testFullyAutomaticAuthorizationUI(OAuthVersion version) {
-        assertDoesNotThrow(() -> new FullyAutomaticAuthorizationUI("", MainApplication.worker, version));
-    }
-}
diff --git test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanelTest.java test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanelTest.java
deleted file mode 100644
index 28f3489304..0000000000
--- test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanelTest.java
+++ /dev/null
@@ -1,21 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.oauth;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import org.junit.jupiter.api.Test;
-import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
-
-/**
- * Unit tests of {@link FullyAutomaticPropertiesPanel} class.
- */
-@BasicPreferences
-class FullyAutomaticPropertiesPanelTest {
-    /**
-     * Unit test of {@link FullyAutomaticPropertiesPanel#FullyAutomaticPropertiesPanel}.
-     */
-    @Test
-    void testFullyAutomaticPropertiesPanel() {
-        assertTrue(new FullyAutomaticPropertiesPanel().getComponentCount() > 0);
-    }
-}
diff --git test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java
deleted file mode 100644
index 9f702c29e8..0000000000
--- test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.oauth;
-
-import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
-
-import org.junit.jupiter.api.Test;
-import org.openstreetmap.josm.data.oauth.OAuthVersion;
-import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
-
-/**
- * Unit tests of {@link ManualAuthorizationUI} class.
- */
-@BasicPreferences
-class ManualAuthorizationUITest {
-    /**
-     * Unit test of {@link ManualAuthorizationUI#ManualAuthorizationUI}.
-     */
-    @Test
-    void testManualAuthorizationUI() {
-        assertDoesNotThrow(() -> new ManualAuthorizationUI("", MainApplication.worker, OAuthVersion.OAuth20));
-    }
-}
diff --git test/unit/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanelTest.java test/unit/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanelTest.java
new file mode 100644
index 0000000000..a8b5f00969
--- /dev/null
+++ test/unit/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanelTest.java
@@ -0,0 +1,146 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.preferences.server;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.lang.reflect.Field;
+
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+import org.openstreetmap.josm.actions.ExpertToggleAction;
+import org.openstreetmap.josm.data.oauth.OAuthAccessTokenHolder;
+import org.openstreetmap.josm.data.oauth.OAuthVersion;
+import org.openstreetmap.josm.gui.oauth.AdvancedOAuthPropertiesPanel;
+import org.openstreetmap.josm.io.NetworkManager;
+import org.openstreetmap.josm.io.OnlineResource;
+import org.openstreetmap.josm.io.OsmApi;
+import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.tools.ReflectionUtils;
+
+/**
+ * Unit tests of {@link AuthenticationPreferencesPanel}.
+ */
+@BasicPreferences
+class AuthenticationPreferencesPanelTest {
+
+    @AfterEach
+    void tearDown() {
+        OAuthAccessTokenHolder.getInstance().clear();
+        ExpertToggleAction.getInstance().setExpert(false);
+        NetworkManager.setOnline(OnlineResource.ALL);
+        Config.getPref().put("osm-server.auth-method", null);
+        Config.getPref().put("osm-server.url", null);
+    }
+
+    private static AuthenticationPreferencesPanel createPanel(String authMethod) {
+        // the OAuth panel looks up the default parameters of the API, which must not make a network request
+        NetworkManager.setOffline(OnlineResource.ALL);
+        Config.getPref().put("osm-server.auth-method", authMethod);
+        return new AuthenticationPreferencesPanel();
+    }
+
+    private static Object getField(AuthenticationPreferencesPanel panel, String name) throws ReflectiveOperationException {
+        final Field field = AuthenticationPreferencesPanel.class.getDeclaredField(name);
+        ReflectionUtils.setObjectsAccessible(field);
+        return field.get(panel);
+    }
+
+    private static boolean isMethodChoiceVisible(AuthenticationPreferencesPanel panel) throws ReflectiveOperationException {
+        return ((JPanel) getField(panel, "pnlAuthenticationMethod")).isVisible();
+    }
+
+    /**
+     * Basic authentication is for experts: a normal user using OAuth 2.0 is not offered the choice.
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     */
+    @Test
+    void testMethodChoiceHiddenFromNormalUsers() throws ReflectiveOperationException {
+        ExpertToggleAction.getInstance().setExpert(false);
+        assertFalse(isMethodChoiceVisible(createPanel("oauth20")));
+    }
+
+    /**
+     * A normal user whose profile still uses basic authentication keeps seeing the setting, so that it can be changed.
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     */
+    @Test
+    void testMethodChoiceShownWhileBasicAuthenticationIsUsed() throws ReflectiveOperationException {
+        ExpertToggleAction.getInstance().setExpert(false);
+        final AuthenticationPreferencesPanel panel = createPanel("basic");
+        assertTrue(((JRadioButton) getField(panel, "rbBasicAuthentication")).isSelected());
+        assertTrue(isMethodChoiceVisible(panel));
+    }
+
+    /**
+     * Basic authentication is not offered for the servers which accept OAuth 2.0 only, even to experts, unless it
+     * is in use already, so that it can be changed.
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     */
+    @Test
+    void testNoBasicAuthenticationForOAuthOnlyServers() throws ReflectiveOperationException {
+        ExpertToggleAction.getInstance().setExpert(true);
+        for (String apiUrl : new String[] {Config.getUrls().getDefaultOsmApiUrl(), "https://opengeofiction.net/api",
+                "https://opengeofiction.net/api/"}) {
+            Config.getPref().put("osm-server.url", apiUrl);
+            assertFalse(((JRadioButton) getField(createPanel("oauth20"), "rbBasicAuthentication")).isEnabled(), apiUrl);
+            assertTrue(((JRadioButton) getField(createPanel("basic"), "rbBasicAuthentication")).isEnabled(),
+                    () -> apiUrl + ": a user of basic authentication could not leave it");
+        }
+        Config.getPref().put("osm-server.url", "https://nonprod-mapops.example.org/api");
+        assertTrue(((JRadioButton) getField(createPanel("oauth20"), "rbBasicAuthentication")).isEnabled());
+    }
+
+    /**
+     * Choosing the authentication method does not save what was entered in the OAuth preferences: only OK does.
+     * <p>
+     * Non-regression test: selecting OAuth 2.0 saved the OAuth preferences, and so an Access Token pasted but not
+     * confirmed with OK.
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     */
+    @Test
+    void testChoosingTheMethodDoesNotSaveTheToken() throws ReflectiveOperationException {
+        final AuthenticationPreferencesPanel panel = createPanel("oauth20");
+        final Object oauth = getField(panel, "pnlOAuth20Preferences");
+        final Field pnlAdvancedProperties = OAuthAuthenticationPreferencesPanel.class.getDeclaredField("pnlAdvancedProperties");
+        ReflectionUtils.setObjectsAccessible(pnlAdvancedProperties);
+        ((AdvancedOAuthPropertiesPanel) pnlAdvancedProperties.get(oauth)).setAccessToken("a-pasted-token");
+
+        ((JRadioButton) getField(panel, "rbBasicAuthentication")).setSelected(true);
+        ((JRadioButton) getField(panel, "rbOAuth20")).setSelected(true);
+
+        assertNull(Config.getPref().get("oauth.access-token.object.OAuth20." + OsmApi.getOsmApi().getHost(), null),
+                "the token was saved without OK");
+        assertNull(OAuthAccessTokenHolder.getInstance().getAccessToken(OsmApi.getOsmApi().getServerUrl(), OAuthVersion.OAuth20));
+    }
+
+    /**
+     * The choice follows expert mode, unless basic authentication is selected.
+     * <p>
+     * {@link ExpertToggleAction} only keeps weak references to its listeners, so the panel has to hold on to its
+     * own; the garbage collection makes sure the test notices if it does not.
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     */
+    @Test
+    void testMethodChoiceFollowsExpertMode() throws ReflectiveOperationException {
+        ExpertToggleAction.getInstance().setExpert(true);
+        final AuthenticationPreferencesPanel panel = createPanel("oauth20");
+        assertTrue(isMethodChoiceVisible(panel));
+        System.gc();
+
+        ExpertToggleAction.getInstance().setExpert(false);
+        assertFalse(isMethodChoiceVisible(panel));
+        ExpertToggleAction.getInstance().setExpert(true);
+        assertTrue(isMethodChoiceVisible(panel));
+
+        // an expert selects basic authentication, then leaves expert mode: the setting stays in sight
+        ((JRadioButton) getField(panel, "rbBasicAuthentication")).setSelected(true);
+        ExpertToggleAction.getInstance().setExpert(false);
+        assertTrue(isMethodChoiceVisible(panel));
+    }
+}
diff --git test/unit/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanelTest.java test/unit/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanelTest.java
index f9afe52a5d..04f5911a00 100644
--- test/unit/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanelTest.java
+++ test/unit/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanelTest.java
@@ -3,32 +3,57 @@ package org.openstreetmap.josm.gui.preferences.server;
 
 import static org.junit.jupiter.api.Assertions.assertAll;
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.GraphicsEnvironment;
 import java.lang.reflect.Field;
 import java.net.Authenticator;
+import java.net.URI;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
+import java.util.stream.Stream;
 
 import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JOptionPane;
 import javax.swing.JPanel;
+import javax.swing.JTextField;
 
 import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.EnumSource;
+import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.oauth.OAuth20Exception;
 import org.openstreetmap.josm.data.oauth.OAuth20Parameters;
 import org.openstreetmap.josm.data.oauth.OAuth20Token;
 import org.openstreetmap.josm.data.oauth.OAuthAccessTokenHolder;
+import org.openstreetmap.josm.data.oauth.OAuthParameters;
 import org.openstreetmap.josm.data.oauth.OAuthVersion;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.gui.oauth.AdvancedOAuthPropertiesPanel;
+import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.io.NetworkManager;
+import org.openstreetmap.josm.io.OnlineResource;
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.io.auth.CredentialsAgentException;
 import org.openstreetmap.josm.io.auth.CredentialsManager;
+import org.openstreetmap.josm.io.remotecontrol.RemoteControl;
+import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
+import org.openstreetmap.josm.testutils.mockers.OpenBrowserMocker;
+import org.openstreetmap.josm.testutils.mockers.WindowMocker;
+import org.openstreetmap.josm.tools.HttpClient;
 import org.openstreetmap.josm.tools.ReflectionUtils;
 
 /**
@@ -55,6 +80,10 @@ class OAuthAuthenticationPreferencesPanelTest {
         }
 
         assertAll(exceptionList.stream().map(e -> () -> fail(e)));
+        // removing a token keeps the OAuth settings of the server
+        Config.getPref().removeSensitive("oauth.access-token.parameters.OAuth20." + OsmApi.getOsmApi().getHost());
+        Config.getPref().put("oauth.settings.use-default." + OsmApi.getOsmApi().getHost(), null);
+        NetworkManager.setOnline(OnlineResource.ALL);
     }
 
     @ParameterizedTest
@@ -73,12 +102,11 @@ class OAuthAuthenticationPreferencesPanelTest {
         panel.initFromPreferences();
         assertSame(pnlAlreadyAuthorised.get(panel), holder.getComponent(0), "Authentication should now be set");
         assertNotNull(getAuthorization(oAuthVersion));
-        final JPanel buttons = (JPanel) ((JPanel) pnlAlreadyAuthorised.get(panel)).getComponent(5);
-        final JButton action = (JButton) buttons.getComponent(2);
+        final JButton action = (JButton) getAlreadyAuthorisedButtons(panel).getComponent(2);
         assertEquals(tr("Remove token"), action.getText(), "The selected button should be for removing the token");
         action.getAction().actionPerformed(null);
         panel.saveToPreferences(); // Save to preferences should make the removal permanent
-        // Ensure that the token holder has been reset for OAuth 1.0a
+        // Ensure that the token holder has been reset
         OAuthAccessTokenHolder.getInstance().clear();
         OAuthAccessTokenHolder.getInstance().init(CredentialsManager.getInstance());
         assertNull(getAuthorization(oAuthVersion), "No authentication data should be stored");
@@ -86,6 +114,359 @@ class OAuthAuthenticationPreferencesPanelTest {
         assertSame(pnlNotYetAuthorised.get(panel), holder.getComponent(0), "No authentication should be set");
     }
 
+    /**
+     * The "New Access Token" button follows the client id entered in the advanced OAuth parameters, like the
+     * "Authorize now" button does. Non-regression test: the buttons of the panel shown when a token exists were
+     * looked up by component index, which pointed at the filler panel instead, so this button was never updated.
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     * @throws CredentialsAgentException if the token cannot be stored
+     * @throws OAuth20Exception if the token cannot be built
+     * @throws ExecutionException if waiting for the worker fails
+     * @throws InterruptedException if waiting for the worker is interrupted
+     */
+    @Test
+    void testRenewButtonFollowsTheClientId() throws ReflectiveOperationException, CredentialsAgentException, OAuth20Exception,
+            ExecutionException, InterruptedException {
+        // the default parameters of the API would otherwise be looked up with an RFC 8414 request
+        NetworkManager.setOffline(OnlineResource.ALL);
+        try {
+            final OAuthAuthenticationPreferencesPanel panel = new OAuthAuthenticationPreferencesPanel(OAuthVersion.OAuth20);
+            addAuthorization(OAuthVersion.OAuth20);
+            panel.initFromPreferences();
+            waitForWorkerAndEdt();
+
+            final Field pnlAdvancedProperties = OAuthAuthenticationPreferencesPanel.class.getDeclaredField("pnlAdvancedProperties");
+            final Field cbUseDefaults = AdvancedOAuthPropertiesPanel.class.getDeclaredField("cbUseDefaults");
+            final Field tfClientId = AdvancedOAuthPropertiesPanel.class.getDeclaredField("tfClientId");
+            ReflectionUtils.setObjectsAccessible(pnlAdvancedProperties, cbUseDefaults, tfClientId);
+            final AdvancedOAuthPropertiesPanel advanced = (AdvancedOAuthPropertiesPanel) pnlAdvancedProperties.get(panel);
+            ((JCheckBox) cbUseDefaults.get(advanced)).setSelected(false);
+            final JTextField clientId = (JTextField) tfClientId.get(advanced);
+            final JButton renew = (JButton) getAlreadyAuthorisedButtons(panel).getComponent(0);
+            assertEquals(tr("New Access Token"), renew.getText());
+
+            clientId.setText("");
+            assertFalse(renew.isEnabled(), "without a client id there is nothing to authorize with");
+            clientId.setText("a-client-id");
+            assertTrue(renew.isEnabled());
+        } finally {
+            NetworkManager.setOnline(OnlineResource.ALL);
+            Config.getPref().put("oauth.settings.use-default", null);
+        }
+    }
+
+    /**
+     * Removing the token keeps the OAuth settings entered for the server, so that a new token can be obtained
+     * without entering them again.
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     * @throws CredentialsAgentException if the token cannot be stored
+     * @throws OAuth20Exception if the token cannot be built
+     * @throws ExecutionException if waiting for the worker fails
+     * @throws InterruptedException if waiting for the worker is interrupted
+     */
+    @Test
+    void testRemoveTokenKeepsTheEnteredSettings() throws ReflectiveOperationException, CredentialsAgentException, OAuth20Exception,
+            ExecutionException, InterruptedException {
+        // the default parameters of the API would otherwise be looked up with an RFC 8414 request
+        NetworkManager.setOffline(OnlineResource.ALL);
+        // the user entered the settings, and obtained a token with them
+        OAuthParameters.setUseDefault(OsmApi.getOsmApi().getServerUrl(), false);
+        addAuthorization(OAuthVersion.OAuth20);
+        final OAuthAuthenticationPreferencesPanel panel = new OAuthAuthenticationPreferencesPanel(OAuthVersion.OAuth20);
+        panel.initFromPreferences();
+        waitForWorkerAndEdt();
+        ((JButton) getAlreadyAuthorisedButtons(panel).getComponent(2)).getAction().actionPerformed(null);
+        panel.saveToPreferences();
+        assertNull(getAuthorization(OAuthVersion.OAuth20));
+
+        final OAuthAuthenticationPreferencesPanel reopened = new OAuthAuthenticationPreferencesPanel(OAuthVersion.OAuth20);
+        reopened.initFromPreferences();
+        waitForWorkerAndEdt();
+        final AdvancedOAuthPropertiesPanel advanced = getAdvancedProperties(reopened);
+        assertFalse(advanced.isUseDefaultSettings());
+        assertEquals("fake_id", advanced.getEnteredClientId());
+    }
+
+    /**
+     * The "Authorize now" button is enabled according to the latest change of the advanced OAuth parameters.
+     * <p>
+     * Non-regression test: with "use default settings" ticked, the client id is looked up on the worker thread, and
+     * the result of that lookup was applied even when the parameters had changed again in the meantime, for example
+     * because the box was unticked and no client id entered.
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     * @throws ExecutionException if waiting for the worker fails
+     * @throws InterruptedException if waiting for the worker is interrupted
+     */
+    @Test
+    void testAuthorizeButtonFollowsTheLatestChange() throws ReflectiveOperationException, ExecutionException, InterruptedException {
+        NetworkManager.setOffline(OnlineResource.ALL);
+        final OAuthAuthenticationPreferencesPanel panel = new OAuthAuthenticationPreferencesPanel(OAuthVersion.OAuth20);
+        panel.initFromPreferences();
+        waitForWorkerAndEdt();
+        final AdvancedOAuthPropertiesPanel advanced = getAdvancedProperties(panel);
+        assertTrue(advanced.isUseDefaultSettings());
+        final Field pnlNotYetAuthorised = OAuthAuthenticationPreferencesPanel.class.getDeclaredField("pnlNotYetAuthorised");
+        ReflectionUtils.setObjectsAccessible(pnlNotYetAuthorised);
+        final JButton authorize = (JButton) ((JPanel) pnlNotYetAuthorised.get(panel)).getComponent(1);
+        assertTrue(authorize.isEnabled(), "JOSM has a client id for the default API");
+
+        // hold the worker, so that the lookup made with the default settings finishes after the next change
+        final CountDownLatch latch = new CountDownLatch(1);
+        MainApplication.worker.execute(() -> {
+            try {
+                latch.await();
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+            }
+        });
+        try {
+            ((JTextField) getAdvancedField(advanced, "tfClientId")).setText("");
+            ((JCheckBox) getAdvancedField(advanced, "cbUseDefaults")).setSelected(false);
+            assertFalse(authorize.isEnabled(), "without a client id there is nothing to authorize with");
+        } finally {
+            latch.countDown();
+        }
+        waitForWorkerAndEdt();
+        assertFalse(authorize.isEnabled(), "the lookup made with the default settings overrode a later change");
+    }
+
+    /**
+     * A pasted access token works with nothing else: here for a server JOSM has no client id for, with no client id
+     * entered and no network. It is taken over when the preferences are saved, not before, so that cancelling them
+     * leaves the token as it was.
+     * @throws Exception if a field cannot be accessed, waiting for the worker fails or the request cannot be signed
+     */
+    @Test
+    void testPastedTokenWorksWithNothingElse() throws Exception {
+        NetworkManager.setOffline(OnlineResource.ALL);
+        final String apiUrl = "https://nonprod-mapops.example.org/api";
+        Config.getPref().put("osm-server.url", apiUrl);
+        try {
+            final OAuthAuthenticationPreferencesPanel panel = new OAuthAuthenticationPreferencesPanel(OAuthVersion.OAuth20);
+            panel.initFromPreferences();
+            waitForWorkerAndEdt();
+            final AdvancedOAuthPropertiesPanel advanced = getAdvancedProperties(panel);
+            assertEquals("", advanced.getEnteredClientId());
+
+            final JTextField tfAccessToken = (JTextField) getAdvancedField(advanced, "tfAccessToken");
+            assertTrue(advanced.isUseDefaultSettings());
+            assertTrue(tfAccessToken.isEnabled(), "a token can be pasted while the default settings are used");
+            tfAccessToken.setText(" a-pasted-token\n");
+            tfAccessToken.postActionEvent();
+            assertNull(OAuthAccessTokenHolder.getInstance().getAccessToken(apiUrl, OAuthVersion.OAuth20),
+                    "taken over before the preferences were saved, so cancelling them would not undo it");
+            panel.saveToPreferences();
+
+            final OAuth20Token token = (OAuth20Token) getAuthorization(OAuthVersion.OAuth20);
+            assertNotNull(token, "the token was not saved");
+            assertEquals("a-pasted-token", token.getBearerToken());
+            final HttpClient request = HttpClient.create(URI.create(apiUrl + "/0.6/changeset/create").toURL(), "PUT");
+            token.sign(request);
+            assertEquals("Bearer a-pasted-token", request.getRequestHeader("Authorization"));
+        } finally {
+            CredentialsManager.getInstance().storeOAuthAccessToken(OsmApi.getOsmApi().getHost(), null);
+            Config.getPref().removeSensitive("oauth.access-token.parameters.OAuth20." + OsmApi.getOsmApi().getHost());
+            Config.getPref().put("osm-server.url", null);
+        }
+    }
+
+    /**
+     * A token which the user did not change is kept as it is, rather than replaced by a token built from its text:
+     * that would lose everything else the token holds, such as its parameters.
+     * @throws CredentialsAgentException if the token cannot be stored
+     * @throws OAuth20Exception if the token cannot be built
+     * @throws ExecutionException if waiting for the worker fails
+     * @throws InterruptedException if waiting for the worker is interrupted
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     */
+    @Test
+    void testUnchangedTokenIsKept() throws CredentialsAgentException, OAuth20Exception, ExecutionException, InterruptedException,
+            ReflectiveOperationException {
+        NetworkManager.setOffline(OnlineResource.ALL);
+        addAuthorization(OAuthVersion.OAuth20);
+        final OAuthAuthenticationPreferencesPanel panel = new OAuthAuthenticationPreferencesPanel(OAuthVersion.OAuth20);
+        panel.initFromPreferences();
+        waitForWorkerAndEdt();
+        assertEquals("fake_token", getAdvancedProperties(panel).getAccessToken());
+        panel.saveToPreferences();
+
+        final OAuth20Token token = (OAuth20Token) getAuthorization(OAuthVersion.OAuth20);
+        assertEquals("fake_token", token.getBearerToken());
+        assertEquals("fake_id", token.getParameters().getClientId());
+    }
+
+    /**
+     * Clearing the access token removes it, like the "Remove token" button does.
+     * @throws CredentialsAgentException if the token cannot be stored
+     * @throws OAuth20Exception if the token cannot be built
+     * @throws ExecutionException if waiting for the worker fails
+     * @throws InterruptedException if waiting for the worker is interrupted
+     * @throws ReflectiveOperationException if a field cannot be accessed
+     */
+    @Test
+    void testClearedTokenIsRemoved() throws CredentialsAgentException, OAuth20Exception, ExecutionException, InterruptedException,
+            ReflectiveOperationException {
+        NetworkManager.setOffline(OnlineResource.ALL);
+        addAuthorization(OAuthVersion.OAuth20);
+        final OAuthAuthenticationPreferencesPanel panel = new OAuthAuthenticationPreferencesPanel(OAuthVersion.OAuth20);
+        panel.initFromPreferences();
+        waitForWorkerAndEdt();
+        getAdvancedProperties(panel).setAccessToken("");
+        assertNotNull(OAuthAccessTokenHolder.getInstance().getAccessToken(OsmApi.getOsmApi().getServerUrl(), OAuthVersion.OAuth20),
+                "removed before the preferences were saved, so cancelling them would not undo it");
+        panel.saveToPreferences();
+        assertNull(getAuthorization(OAuthVersion.OAuth20));
+    }
+
+    /**
+     * "Test Access Token" tests the token in the field: with the field cleared there is none to test, rather than
+     * the stored token, which the user is about to remove.
+     * @throws Exception if a field cannot be accessed, the token cannot be stored or waiting for the worker fails
+     */
+    @Test
+    void testNothingToTestWhenTheTokenIsCleared() throws Exception {
+        TestUtils.assumeWorkingJMockit();
+        if (GraphicsEnvironment.isHeadless()) {
+            new WindowMocker();
+        }
+        final JOptionPaneSimpleMocker mocker = new JOptionPaneSimpleMocker(Collections.singletonMap(
+                "There is no Access Token to test.", JOptionPane.OK_OPTION));
+        NetworkManager.setOffline(OnlineResource.ALL);
+        addAuthorization(OAuthVersion.OAuth20);
+        final OAuthAuthenticationPreferencesPanel panel = new OAuthAuthenticationPreferencesPanel(OAuthVersion.OAuth20);
+        panel.initFromPreferences();
+        waitForWorkerAndEdt();
+        getAdvancedProperties(panel).setAccessToken("");
+        final JButton test = (JButton) getAlreadyAuthorisedButtons(panel).getComponent(1);
+        assertEquals(tr("Test Access Token"), test.getText());
+
+        test.doClick();
+        assertEquals(1, mocker.getInvocationLog().size(), "the stored token was tested instead");
+    }
+
+    /**
+     * "Authorize now" authorizes JOSM in the web browser straight away, with the OAuth parameters shown in the panel.
+     * @throws Exception if a field cannot be accessed or waiting for the worker fails
+     */
+    @Test
+    void testAuthorizeNowUsesTheDisplayedParameters() throws Exception {
+        TestUtils.assumeWorkingJMockit();
+        new OpenBrowserMocker();
+        OpenBrowserMocker.getCalledURIs().clear();
+        NetworkManager.setOffline(OnlineResource.ALL);
+        RemoteControl.stop();
+        try {
+            final OAuthAuthenticationPreferencesPanel panel = new OAuthAuthenticationPreferencesPanel(OAuthVersion.OAuth20);
+            panel.initFromPreferences();
+            waitForWorkerAndEdt();
+            final AdvancedOAuthPropertiesPanel advanced = getAdvancedProperties(panel);
+            advanced.setAdvancedParameters(new OAuth20Parameters("an-entered-client-id", null, "https://example.org/oauth2/token",
+                    "https://example.org/oauth2/authorize", OsmApi.getOsmApi().getServerUrl(), "http://127.0.0.1:8111/oauth_authorization"));
+            assertFalse(advanced.isUseDefaultSettings());
+            final Field pnlNotYetAuthorised = OAuthAuthenticationPreferencesPanel.class.getDeclaredField("pnlNotYetAuthorised");
+            ReflectionUtils.setObjectsAccessible(pnlNotYetAuthorised);
+            final JButton authorize = (JButton) ((JPanel) pnlNotYetAuthorised.get(panel)).getComponent(1);
+            assertEquals(tr("Authorize now"), authorize.getText());
+
+            authorize.doClick();
+            GuiHelper.runInEDTAndWait(() -> { });
+
+            assertEquals(1, OpenBrowserMocker.getCalledURIs().size());
+            final String url = OpenBrowserMocker.getCalledURIs().get(0).toString();
+            assertTrue(url.startsWith("https://example.org/oauth2/authorize?"), url);
+            assertTrue(url.contains("client_id=an-entered-client-id"), url);
+        } finally {
+            RemoteControl.stop();
+        }
+    }
+
+    /**
+     * A failed attempt at a new Access Token leaves the token JOSM has as it is.
+     * <p>
+     * Non-regression test: the token was replaced by none whenever the authorization failed, for example when the
+     * server refused to exchange the code for a token, so a failed renewal lost a working token.
+     * @throws Exception if a field cannot be accessed, the token cannot be stored or the redirect cannot be sent
+     */
+    @Test
+    void testFailedRenewalKeepsTheToken() throws Exception {
+        TestUtils.assumeWorkingJMockit();
+        new OpenBrowserMocker();
+        OpenBrowserMocker.getCalledURIs().clear();
+        new JOptionPaneSimpleMocker(Collections.singletonMap(
+                "Authentication failed, please check browser for details.", JOptionPane.OK_OPTION));
+        NetworkManager.setOffline(OnlineResource.ALL);
+        RemoteControl.stop();
+        addAuthorization(OAuthVersion.OAuth20);
+        try {
+            final OAuthAuthenticationPreferencesPanel panel = new OAuthAuthenticationPreferencesPanel(OAuthVersion.OAuth20);
+            panel.initFromPreferences();
+            waitForWorkerAndEdt();
+            // the token request goes to a port nothing listens on, so that the exchange fails
+            getAdvancedProperties(panel).setAdvancedParameters(new OAuth20Parameters("an-entered-client-id", null,
+                    "http://127.0.0.1:1/oauth2/token", "https://example.org/oauth2/authorize",
+                    OsmApi.getOsmApi().getServerUrl(), "http://127.0.0.1:8111/oauth_authorization"));
+            final JButton renew = (JButton) getAlreadyAuthorisedButtons(panel).getComponent(0);
+            assertEquals(tr("New Access Token"), renew.getText());
+
+            renew.doClick();
+            GuiHelper.runInEDTAndWait(() -> { });
+            assertEquals(1, OpenBrowserMocker.getCalledURIs().size());
+            final String state = Stream.of(OpenBrowserMocker.getCalledURIs().get(0).getQuery().split("&"))
+                    .filter(p -> p.startsWith("state=")).map(p -> p.substring("state=".length())).findFirst().orElseThrow();
+            // the web browser is redirected to JOSM with a code
+            final HttpClient redirect = HttpClient.create(
+                    URI.create("http://127.0.0.1:8111/oauth_authorization?code=a-code&state=" + state).toURL());
+            try {
+                redirect.connect();
+            } finally {
+                redirect.disconnect();
+            }
+            GuiHelper.runInEDTAndWait(() -> { });
+
+            final OAuth20Token token = (OAuth20Token) getAuthorization(OAuthVersion.OAuth20);
+            assertNotNull(token, "the token was lost");
+            assertEquals("fake_token", token.getBearerToken());
+        } finally {
+            RemoteControl.stop();
+        }
+    }
+
+    private static AdvancedOAuthPropertiesPanel getAdvancedProperties(OAuthAuthenticationPreferencesPanel panel)
+            throws ReflectiveOperationException {
+        final Field pnlAdvancedProperties = OAuthAuthenticationPreferencesPanel.class.getDeclaredField("pnlAdvancedProperties");
+        ReflectionUtils.setObjectsAccessible(pnlAdvancedProperties);
+        return (AdvancedOAuthPropertiesPanel) pnlAdvancedProperties.get(panel);
+    }
+
+    private static Object getAdvancedField(AdvancedOAuthPropertiesPanel advanced, String name) throws ReflectiveOperationException {
+        final Field field = AdvancedOAuthPropertiesPanel.class.getDeclaredField(name);
+        ReflectionUtils.setObjectsAccessible(field);
+        return field.get(advanced);
+    }
+
+    /**
+     * Waits until the panel has settled. The advanced parameters fill themselves in from the worker, then the EDT,
+     * and setting them re-evaluates the "Authorize now" buttons, which queues more work on the worker that again
+     * finishes on the EDT; so this goes round twice.
+     * @throws ExecutionException if waiting for the worker fails
+     * @throws InterruptedException if waiting for the worker is interrupted
+     */
+    private static void waitForWorkerAndEdt() throws ExecutionException, InterruptedException {
+        for (int i = 0; i < 2; i++) {
+            MainApplication.worker.submit(() -> { }).get();
+            GuiHelper.runInEDTAndWait(() -> { });
+        }
+    }
+
+    private static JPanel getAlreadyAuthorisedButtons(OAuthAuthenticationPreferencesPanel panel) throws ReflectiveOperationException {
+        final Field pnlAlreadyAuthorised = OAuthAuthenticationPreferencesPanel.class.getDeclaredField("pnlAlreadyAuthorised");
+        ReflectionUtils.setObjectsAccessible(pnlAlreadyAuthorised);
+        final Object alreadyAuthorised = pnlAlreadyAuthorised.get(panel);
+        final Field pnlButtons = alreadyAuthorised.getClass().getDeclaredField("pnlButtons");
+        ReflectionUtils.setObjectsAccessible(pnlButtons);
+        return (JPanel) pnlButtons.get(alreadyAuthorised);
+    }
+
     /**
      * Add authorization preferences for the specified oauth version
      * @param oAuthVersion The oauth version to use
diff --git test/unit/org/openstreetmap/josm/io/OsmConnectionTest.java test/unit/org/openstreetmap/josm/io/OsmConnectionTest.java
index c9605090c9..8aaad2164d 100644
--- test/unit/org/openstreetmap/josm/io/OsmConnectionTest.java
+++ test/unit/org/openstreetmap/josm/io/OsmConnectionTest.java
@@ -2,27 +2,34 @@
 package org.openstreetmap.josm.io;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
+import java.awt.GraphicsEnvironment;
 import java.net.MalformedURLException;
 import java.net.URI;
+import java.util.Collections;
 
 import javax.swing.JOptionPane;
 
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.oauth.IOAuthParameters;
 import org.openstreetmap.josm.data.oauth.OAuth20Exception;
 import org.openstreetmap.josm.data.oauth.OAuth20Parameters;
 import org.openstreetmap.josm.data.oauth.OAuth20Token;
 import org.openstreetmap.josm.data.oauth.OAuthAccessTokenHolder;
+import org.openstreetmap.josm.data.oauth.OAuthParameters;
 import org.openstreetmap.josm.data.oauth.OAuthVersion;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
+import org.openstreetmap.josm.testutils.mockers.WindowMocker;
 import org.openstreetmap.josm.tools.HttpClient;
 
 /**
@@ -54,7 +61,8 @@ class OsmConnectionTest {
         NetworkManager.setOnline(OnlineResource.ALL);
         OAuthAccessTokenHolder.getInstance().clear();
         // preferences and the token holder are static state shared with the other tests of this class
-        Config.getPref().put("oauth.access-token.parameters." + OAuthVersion.OAuth20 + "." + API_URL, null);
+        Config.getPref().put("oauth.access-token.parameters." + OAuthVersion.OAuth20 + "." + URI.create(API_URL).getHost(), null);
+        Config.getPref().put("oauth.settings.use-default." + URI.create(API_URL).getHost(), null);
         Config.getPref().put("osm-server.url", null);
     }
 
@@ -63,10 +71,11 @@ class OsmConnectionTest {
     }
 
     /**
-     * Stores the advanced OAuth parameters the way the authentication preferences do, that is under the API URL.
+     * Stores the advanced OAuth parameters the way the authentication preferences do.
      */
     private static OAuth20Parameters rememberParameters() {
         final OAuth20Parameters parameters = new OAuth20Parameters(CLIENT_ID, null, API_URL, API_URL, REDIRECT_URI);
+        OAuthParameters.setUseDefault(API_URL, false);
         parameters.rememberPreferences();
         return parameters;
     }
@@ -114,10 +123,47 @@ class OsmConnectionTest {
         final MissingOAuthAccessTokenException thrown = assertThrows(MissingOAuthAccessTokenException.class,
                 () -> new TestConnection().addOAuth20AuthorizationHeader(client));
         assertNotNull(thrown.getMessage(), "gave up only after asking the user, rather than for the missing client id");
+        assertTrue(thrown.isClientIdMissing(), "the user is not told what is missing");
         assertTrue(thrown.getMessage().contains(API_URL), thrown.getMessage());
         assertNull(client.getRequestHeader("Authorization"));
     }
 
+    /**
+     * A token is obtained for the API, so for a request to another host JOSM does not ask the user to authorize it,
+     * which would not give a token for that request anyway.
+     * @throws MalformedURLException never
+     */
+    @Test
+    void testNoAuthorizationForAnotherHost() throws MalformedURLException {
+        TestUtils.assumeWorkingJMockit();
+        if (GraphicsEnvironment.isHeadless()) {
+            new WindowMocker();
+        }
+        final JOptionPaneSimpleMocker mocker = new JOptionPaneSimpleMocker(
+                Collections.singletonMap("Obtain OAuth 2.0 token for authentication?", JOptionPane.NO_OPTION));
+        rememberParameters();
+
+        final HttpClient client = HttpClient.create(URI.create("https://elsewhere.example.org/api/0.6/user/details").toURL());
+        final MissingOAuthAccessTokenException thrown = assertThrows(MissingOAuthAccessTokenException.class,
+                () -> new TestConnection().addOAuth20AuthorizationHeader(client));
+        assertFalse(thrown.isClientIdMissing());
+        assertEquals(0, mocker.getInvocationLog().size(), "asked to obtain a token for another host");
+    }
+
+    /**
+     * A token pasted by the user signs the connection with nothing else: no client id, no endpoints, no network.
+     * @throws Exception if the connection cannot be signed
+     */
+    @Test
+    void testPastedTokenSignsTheConnection() throws Exception {
+        OAuthAccessTokenHolder.getInstance().setAccessToken(API_URL,
+                OAuth20Token.fromAccessToken(new OAuth20Parameters("", null, "", "", API_URL, ""), "a-pasted-token"));
+
+        final HttpClient client = apiRequest();
+        new TestConnection().addOAuth20AuthorizationHeader(client);
+        assertEquals("Bearer a-pasted-token", client.getRequestHeader("Authorization"));
+    }
+
     /**
      * An existing token is used without the parameters having to be stored, since the token carries its own.
      * @throws OAuth20Exception if the token cannot be built
diff --git test/unit/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgentTest.java test/unit/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgentTest.java
index ef32f68bed..1e93d4d81c 100644
--- test/unit/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgentTest.java
+++ test/unit/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgentTest.java
@@ -1,6 +1,7 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.io.auth;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
@@ -25,11 +26,12 @@ class JosmPreferencesCredentialAgentTest implements CredentialsAgentTest<JosmPre
     }
 
     /**
-     * Removing an OAuth token removes it from the preferences, not only the parameters stored with it.
+     * Removing an OAuth token removes it from the preferences, and keeps the parameters stored with it: they are the
+     * OAuth settings of the server too, which are needed to obtain the next token.
      * <p>
-     * Non-regression test: both keys were built with the {@code parameters} prefix, so the token itself stayed in the
-     * preferences in clear text. {@link CredentialsAgentTest#testLookupAndStoreOAuthTokens} did not notice, because a
-     * lookup needs both keys and so already fails once the parameters are gone.
+     * Non-regression test for #24932: both keys were built with the {@code parameters} prefix, so the token itself
+     * stayed in the preferences in clear text. {@link CredentialsAgentTest#testLookupAndStoreOAuthTokens} did not
+     * notice, because a lookup needs both keys and so already failed once the parameters were gone.
      * @throws CredentialsAgentException if the token cannot be stored or removed
      * @throws OAuth20Exception if the token cannot be built
      */
@@ -44,13 +46,15 @@ class JosmPreferencesCredentialAgentTest implements CredentialsAgentTest<JosmPre
                 "https://example.org/api", "https://example.org/api", "http://127.0.0.1:8111/oauth_authorization"),
                 "{\"access_token\": \"a-secret-token\", \"token_type\": \"bearer\"}"));
         assertNotNull(Config.getPref().get(tokenKey, null));
-        assertNotNull(Config.getPref().get(parametersKey, null));
+        final String parameters = Config.getPref().get(parametersKey, null);
+        assertNotNull(parameters);
 
         agent.storeOAuthAccessToken(host, null);
 
         assertNull(Config.getPref().get(tokenKey, null), "the token is still stored in the preferences");
-        assertNull(Config.getPref().get(parametersKey, null));
         assertFalse(Config.getPref().getSensitive().contains(tokenKey));
-        assertFalse(Config.getPref().getSensitive().contains(parametersKey));
+        assertNull(agent.lookupOAuthAccessToken(host));
+        assertEquals(parameters, Config.getPref().get(parametersKey, null), "the OAuth settings of the server are gone");
+        Config.getPref().removeSensitive(parametersKey);
     }
 }
diff --git test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
index f33894ff38..4faa2ca408 100644
--- test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
+++ test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
@@ -50,12 +50,10 @@ import org.openstreetmap.josm.data.preferences.JosmUrls;
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard;
 import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreferenceTestIT;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.io.OsmApiInitializationException;
-import org.openstreetmap.josm.io.OsmConnection;
 import org.openstreetmap.josm.io.OsmTransferCanceledException;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.spi.preferences.Setting;
@@ -549,7 +547,6 @@ public class JOSMTestRules implements TestRule, AfterEachCallback, BeforeEachCal
         User.clearUserMap();
         // Setup callbacks
         DeleteCommand.setDeletionCallback(DeleteAction.defaultDeletionCallback);
-        OsmConnection.setOAuthAccessTokenFetcher(OAuthAuthorizationWizard::obtainAccessToken);
         HttpClient.setFactory(Http1Client::new);
 
         // Set up i18n
diff --git test/unit/org/openstreetmap/josm/testutils/annotations/JosmDefaults.java test/unit/org/openstreetmap/josm/testutils/annotations/JosmDefaults.java
index 4146eb450f..3a2d927675 100644
--- test/unit/org/openstreetmap/josm/testutils/annotations/JosmDefaults.java
+++ test/unit/org/openstreetmap/josm/testutils/annotations/JosmDefaults.java
@@ -20,9 +20,7 @@ import org.openstreetmap.josm.command.DeleteCommand;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.UserIdentityManager;
 import org.openstreetmap.josm.data.osm.User;
-import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard;
 import org.openstreetmap.josm.gui.util.GuiHelper;
-import org.openstreetmap.josm.io.OsmConnection;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.MemoryManagerTest;
@@ -59,7 +57,6 @@ public @interface JosmDefaults {
             User.clearUserMap();
             // Setup callbacks
             DeleteCommand.setDeletionCallback(DeleteAction.defaultDeletionCallback);
-            OsmConnection.setOAuthAccessTokenFetcher(OAuthAuthorizationWizard::obtainAccessToken);
         }
 
         @Override
diff --git test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java
index c5178d3863..3c99473224 100644
--- test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java
+++ test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java
@@ -2,6 +2,7 @@
 package org.openstreetmap.josm.tools;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
 import java.net.HttpURLConnection;
@@ -277,6 +278,18 @@ class ExceptionUtilTest {
                 ExceptionUtil.explainMissingOAuthAccessTokenException(new MissingOAuthAccessTokenException()));
     }
 
+    /**
+     * Without a client id, JOSM cannot obtain a token, and says so rather than to generate one.
+     */
+    @Test
+    void testExplainMissingOAuthClientId() {
+        // the server JOSM gave up on, whichever is configured by the time this is explained
+        final String explanation = ExceptionUtil.explainMissingOAuthAccessTokenException(
+                MissingOAuthAccessTokenException.clientIdMissing("https://other.example.org/api"));
+        assertTrue(explanation.contains("'https://other.example.org/api'"), explanation);
+        assertTrue(explanation.contains("because it has no OAuth Client ID for it"), explanation);
+    }
+
     /**
      * Test of {@link ExceptionUtil#explainNestedIllegalDataException} method.
      */
