File: 60-disable_oauth.patch

package info (click to toggle)
josm 0.0.svn3376-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 53,192 kB
  • ctags: 15,964
  • sloc: java: 109,690; xml: 7,599; perl: 821; makefile: 51; sh: 21
file content (602 lines) | stat: -rw-r--r-- 26,283 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
From: David Paleino <dapal@debian.org>
Subject: disable everything OAuth-related, since we're missing packaged
 dependencies.
Forwarded: not-needed, Debian-specific

---
 build.xml                                                                                  |    3 -
 src/org/openstreetmap/josm/actions/ShowStatusReportAction.java                             |    5 +
 src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java                                    |   12 +++-
 src/org/openstreetmap/josm/gui/MainApplication.java                                        |    4 -
 src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java      |   15 ++++-
 src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java              |   10 +++
 src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java |   27 ++++++++--
 src/org/openstreetmap/josm/io/OsmConnection.java                                           |   13 +++-
 src/org/openstreetmap/josm/io/auth/CredentialsManager.java                                 |    6 +-
 src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialManager.java                   |    6 +-
 src/org/openstreetmap/josm/tools/ExceptionUtil.java                                        |    8 ++
 11 files changed, 81 insertions(+), 28 deletions(-)

--- josm.orig/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
+++ josm/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
@@ -95,8 +95,9 @@ public final class ShowStatusReportActio
                     if (toCheck.startsWith("osm-server.username")
                             || toCheck.startsWith("osm-server.password")
                             || toCheck.startsWith("marker.show")
-                            || toCheck.startsWith("oauth.access-token.key")
-                            || toCheck.startsWith("oauth.access-token.secret")) {
+                            ) {
+//                            || toCheck.startsWith("oauth.access-token.key")
+ //                           || toCheck.startsWith("oauth.access-token.secret")) {
                         continue;
                     }
                     text.append(line);
--- josm.orig/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
+++ josm/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
@@ -15,7 +15,7 @@ import javax.swing.JOptionPane;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.io.ChangesetClosedException;
 import org.openstreetmap.josm.io.IllegalDataException;
-import org.openstreetmap.josm.io.MissingOAuthAccessTokenException;
+//import org.openstreetmap.josm.io.MissingOAuthAccessTokenException;
 import org.openstreetmap.josm.io.OsmApiException;
 import org.openstreetmap.josm.io.OsmApiInitializationException;
 import org.openstreetmap.josm.io.OsmTransferException;
@@ -249,11 +249,13 @@ public class ExceptionDialogUtil {
     public static void explainAuthenticationFailed(OsmApiException e) {
         String authMethod = Main.pref.get("osm-server.auth-method", "basic");
         String msg;
+/*
         if (authMethod.equals("oauth")) {
             msg = ExceptionUtil.explainFailedOAuthAuthentication(e);
         } else {
+*/
             msg = ExceptionUtil.explainFailedBasicAuthentication(e);
-        }
+//        }
 
         HelpAwareOptionPane.showOptionDialog(
                 Main.parent,
@@ -273,7 +275,7 @@ public class ExceptionDialogUtil {
     public static void explainAuthorizationFailed(OsmApiException e) {
         HelpAwareOptionPane.showOptionDialog(
                 Main.parent,
-                ExceptionUtil.explainFailedOAuthAuthorisation(e),
+                tr("OAuth authorization disabled by Debian."),
                 tr("Authorisation Failed"),
                 JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#AuthenticationFailed")
@@ -318,6 +320,7 @@ public class ExceptionDialogUtil {
      *
      * @param e the exception
      */
+/*
     public static void explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e) {
         HelpAwareOptionPane.showOptionDialog(
                 Main.parent,
@@ -327,6 +330,7 @@ public class ExceptionDialogUtil {
                 ht("/ErrorMessages#MissingOAuthAccessToken")
         );
     }
+*/
 
     /**
      * Explains a {@see UnknownHostException} which has caused an {@see OsmTransferException}.
@@ -404,10 +408,12 @@ public class ExceptionDialogUtil {
             return;
         }
 
+/*
         if (e instanceof MissingOAuthAccessTokenException) {
             explainMissingOAuthAccessTokenException((MissingOAuthAccessTokenException)e);
             return;
         }
+*/
 
         if (e instanceof OsmApiException) {
             OsmApiException oae = (OsmApiException) e;
--- josm.orig/src/org/openstreetmap/josm/gui/MainApplication.java
+++ josm/src/org/openstreetmap/josm/gui/MainApplication.java
@@ -24,7 +24,7 @@ import java.util.Map;
 import javax.swing.JFrame;
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
+//import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.io.DefaultProxySelector;
 import org.openstreetmap.josm.io.auth.CredentialsManagerFactory;
@@ -177,7 +177,7 @@ public class MainApplication extends Mai
         DefaultAuthenticator.createInstance(CredentialsManagerFactory.getCredentialManager());
         Authenticator.setDefault(DefaultAuthenticator.getInstance());
         ProxySelector.setDefault(new DefaultProxySelector(ProxySelector.getDefault()));
-        OAuthAccessTokenHolder.getInstance().init(Main.pref, CredentialsManagerFactory.getCredentialManager());
+        //OAuthAccessTokenHolder.getInstance().init(Main.pref, CredentialsManagerFactory.getCredentialManager());
 
         // asking for help? show help and exit
         if (args.containsKey("help")) {
--- josm.orig/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
+++ josm/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
@@ -39,7 +39,7 @@ public class AuthenticationPreferencesPa
     /** the panel for the basic authentication parameters */
     private BasicAuthenticationPreferencesPanel pnlBasicAuthPreferences;
     /** the panel for the OAuth authentication parameters */
-    private OAuthAuthenticationPreferencesPanel pnlOAuthPreferences;
+//    private OAuthAuthenticationPreferencesPanel pnlOAuthPreferences;
 
     /**
      * builds the UI
@@ -66,6 +66,7 @@ public class AuthenticationPreferencesPa
         add(rbOAuth = new JRadioButton(), gc);
         rbOAuth.setText(tr("Use OAuth"));
         rbOAuth.setToolTipText(tr("Select to use OAuth as authentication mechanism"));
+        rbOAuth.setEnabled(false);
         rbOAuth.addItemListener(authChangeListener);
 
         //-- radio button for OAuth
@@ -85,7 +86,7 @@ public class AuthenticationPreferencesPa
 
         //-- the two panel for authentication parameters
         pnlBasicAuthPreferences = new BasicAuthenticationPreferencesPanel();
-        pnlOAuthPreferences = new OAuthAuthenticationPreferencesPanel();
+//        pnlOAuthPreferences = new OAuthAuthenticationPreferencesPanel();
 
         rbBasicAuthentication.setSelected(true);
         pnlAuthenticationParameteters.add(pnlBasicAuthPreferences, BorderLayout.CENTER);
@@ -107,7 +108,7 @@ public class AuthenticationPreferencesPa
             rbBasicAuthentication.setSelected(true);
         }
         pnlBasicAuthPreferences.initFromPreferences();
-        pnlOAuthPreferences.initFromPreferences();
+//        pnlOAuthPreferences.initFromPreferences();
     }
 
     public void saveToPreferences() {
@@ -122,6 +123,7 @@ public class AuthenticationPreferencesPa
         if (authMethod.equals("basic")) {
             // save username and password and clear the OAuth token
             pnlBasicAuthPreferences.saveToPreferences();
+/*
             OAuthAccessTokenHolder.getInstance().clear();
             OAuthAccessTokenHolder.getInstance().save(Main.pref, CredentialsManagerFactory.getCredentialManager());
         } else if (authMethod.equals("oauth")) {
@@ -129,6 +131,7 @@ public class AuthenticationPreferencesPa
             pnlBasicAuthPreferences.clearPassword();
             pnlBasicAuthPreferences.saveToPreferences();
             pnlOAuthPreferences.saveToPreferences();
+*/
         }
     }
 
@@ -141,18 +144,22 @@ public class AuthenticationPreferencesPa
                 pnlAuthenticationParameteters.removeAll();
                 pnlAuthenticationParameteters.add(pnlBasicAuthPreferences, BorderLayout.CENTER);
                 pnlBasicAuthPreferences.revalidate();
-            } else {
+/*            } else {
                 pnlAuthenticationParameteters.removeAll();
                 pnlAuthenticationParameteters.add(pnlOAuthPreferences, BorderLayout.CENTER);
                 pnlOAuthPreferences.revalidate();
+*/
             }
+
             repaint();
         }
     }
 
     public void propertyChange(PropertyChangeEvent evt) {
+/*
         if (pnlOAuthPreferences != null) {
             pnlOAuthPreferences.propertyChange(evt);
         }
+*/
     }
 }
--- josm.orig/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java
+++ josm/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java
@@ -6,7 +6,7 @@ import static org.openstreetmap.josm.too
 import java.util.logging.Logger;
 
 import org.openstreetmap.josm.data.Preferences;
-import org.openstreetmap.josm.data.oauth.OAuthToken;
+//import org.openstreetmap.josm.data.oauth.OAuthToken;
 import org.openstreetmap.josm.io.auth.CredentialsManager;
 import org.openstreetmap.josm.io.auth.CredentialsManagerException;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -90,11 +90,13 @@ public class OAuthAccessTokenHolder {
         this.accessTokenSecret = accessTokenSecret;
     }
 
+/*
     public OAuthToken getAccessToken() {
         if (!containsAccessToken())
             return null;
         return new OAuthToken(accessTokenKey, accessTokenSecret);
     }
+*/
 
     /**
      * Sets the access token hold by this holder.
@@ -112,6 +114,7 @@ public class OAuthAccessTokenHolder {
      * 
      * @param token the access token. Can be null to clear the content in this holder.
      */
+/*
     public void setAccessToken(OAuthToken token) {
         if (token == null) {
             this.accessTokenKey = null;
@@ -121,6 +124,7 @@ public class OAuthAccessTokenHolder {
             this.accessTokenSecret = token.getSecret();
         }
     }
+*/
 
     /**
      * Replies true if this holder contains an complete access token, consisting of an
@@ -143,6 +147,7 @@ public class OAuthAccessTokenHolder {
     public void init(Preferences pref, CredentialsManager cm) throws IllegalArgumentException {
         CheckParameterUtil.ensureParameterNotNull(pref, "pref");
         CheckParameterUtil.ensureParameterNotNull(cm, "cm");
+/*
         OAuthToken token = null;
         try {
             token = cm.lookupOAuthAccessToken();
@@ -156,6 +161,7 @@ public class OAuthAccessTokenHolder {
             accessTokenKey = token.getKey();
             accessTokenSecret = token.getSecret();
         }
+*/
     }
 
     /**
@@ -171,6 +177,7 @@ public class OAuthAccessTokenHolder {
         CheckParameterUtil.ensureParameterNotNull(preferences, "preferences");
         CheckParameterUtil.ensureParameterNotNull(cm, "cm");
         preferences.put("oauth.access-token.save-to-preferences", saveToPreferences);
+/*
         try {
             if (!saveToPreferences) {
                 cm.storeOAuthAccessToken(null);
@@ -182,6 +189,7 @@ public class OAuthAccessTokenHolder {
             System.err.println(tr("Warning: Failed to store OAuth Access Token to credentials manager"));
             System.err.println(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
         }
+*/
     }
 
     /**
--- josm.orig/src/org/openstreetmap/josm/io/OsmConnection.java
+++ josm/src/org/openstreetmap/josm/io/OsmConnection.java
@@ -12,12 +12,14 @@ import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 import java.util.logging.Logger;
 
+/*
 import oauth.signpost.OAuthConsumer;
 import oauth.signpost.exception.OAuthException;
+*/
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.oauth.OAuthParameters;
-import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
+//import org.openstreetmap.josm.data.oauth.OAuthParameters;
+//import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
 import org.openstreetmap.josm.io.auth.CredentialsManagerException;
 import org.openstreetmap.josm.io.auth.CredentialsManagerFactory;
 import org.openstreetmap.josm.io.auth.CredentialsManagerResponse;
@@ -35,7 +37,7 @@ public class OsmConnection {
 
     protected boolean cancel = false;
     protected HttpURLConnection activeConnection;
-    protected OAuthParameters oauthParameters;
+//    protected OAuthParameters oauthParameters;
 
     /**
      * Initialize the http defaults and the authenticator.
@@ -111,6 +113,7 @@ public class OsmConnection {
      * @throws OsmTransferException thrown if there is currently no OAuth Access Token configured
      * @throws OsmTransferException thrown if signing fails
      */
+/*
     protected void addOAuthAuthorizationHeader(HttpURLConnection connection) throws OsmTransferException {
         if (oauthParameters == null) {
             oauthParameters = OAuthParameters.createFromPreferences(Main.pref);
@@ -126,13 +129,15 @@ public class OsmConnection {
             throw new OsmTransferException(tr("Failed to sign a HTTP connection with an OAuth Authentication header"), e);
         }
     }
-
+*/
     protected void addAuth(HttpURLConnection connection) throws OsmTransferException {
         String authMethod = Main.pref.get("osm-server.auth-method", "basic");
         if (authMethod.equals("basic")) {
             addBasicAuthorizationHeader(connection);
+/*
         } else if (authMethod.equals("oauth")) {
             addOAuthAuthorizationHeader(connection);
+*/
         } else {
             String msg = tr("Warning: unexpected value for preference ''{0}''. Got ''{1}''.", "osm-server.auth-method", authMethod);
             System.err.println(msg);
--- josm.orig/src/org/openstreetmap/josm/io/auth/CredentialsManager.java
+++ josm/src/org/openstreetmap/josm/io/auth/CredentialsManager.java
@@ -4,7 +4,7 @@ package org.openstreetmap.josm.io.auth;
 import java.net.PasswordAuthentication;
 import java.net.Authenticator.RequestorType;
 
-import org.openstreetmap.josm.data.oauth.OAuthToken;
+//import org.openstreetmap.josm.data.oauth.OAuthToken;
 
 /**
  * A CredentialManager manages two credentials:
@@ -57,7 +57,7 @@ public interface CredentialsManager {
      * @return the current OAuth Access Token to access the OSM server.
      * @throws CredentialsManagerException thrown if something goes wrong
      */
-    public OAuthToken lookupOAuthAccessToken() throws CredentialsManagerException;
+//    public OAuthToken lookupOAuthAccessToken() throws CredentialsManagerException;
 
     /**
      * Stores the OAuth Access Token <code>accessToken</code>.
@@ -65,5 +65,5 @@ public interface CredentialsManager {
      * @param accessToken the access Token. null, to remove the Access Token.
      * @throws CredentialsManagerException thrown if something goes wrong
      */
-    public void storeOAuthAccessToken(OAuthToken accessToken) throws CredentialsManagerException;
+//    public void storeOAuthAccessToken(OAuthToken accessToken) throws CredentialsManagerException;
 }
--- josm.orig/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialManager.java
+++ josm/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialManager.java
@@ -5,7 +5,7 @@ import java.net.PasswordAuthentication;
 import java.net.Authenticator.RequestorType;
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.oauth.OAuthToken;
+//import org.openstreetmap.josm.data.oauth.OAuthToken;
 import org.openstreetmap.josm.gui.io.CredentialDialog;
 import org.openstreetmap.josm.gui.preferences.server.ProxyPreferencesPanel;
 
@@ -112,6 +112,7 @@ public class JosmPreferencesCredentialMa
      * @return the current OAuth Access Token to access the OSM server.
      * @throws CredentialsManagerException thrown if something goes wrong
      */
+/*
     public OAuthToken lookupOAuthAccessToken() throws CredentialsManagerException {
         String accessTokenKey = Main.pref.get("oauth.access-token.key", null);
         String accessTokenSecret = Main.pref.get("oauth.access-token.secret", null);
@@ -119,6 +120,7 @@ public class JosmPreferencesCredentialMa
             return null;
         return new OAuthToken(accessTokenKey, accessTokenSecret);
     }
+*/
 
     /**
      * Stores the OAuth Access Token <code>accessToken</code>.
@@ -126,6 +128,7 @@ public class JosmPreferencesCredentialMa
      * @param accessToken the access Token. null, to remove the Access Token.
      * @throws CredentialsManagerException thrown if something goes wrong
      */
+/*
     public void storeOAuthAccessToken(OAuthToken accessToken) throws CredentialsManagerException {
         if (accessToken == null) {
             Main.pref.put("oauth.access-token.key", null);
@@ -135,4 +138,5 @@ public class JosmPreferencesCredentialMa
             Main.pref.put("oauth.access-token.secret", accessToken.getSecret());
         }
     }
+*/
 }
--- josm.orig/src/org/openstreetmap/josm/tools/ExceptionUtil.java
+++ josm/src/org/openstreetmap/josm/tools/ExceptionUtil.java
@@ -18,10 +18,10 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
+//import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
 import org.openstreetmap.josm.io.ChangesetClosedException;
 import org.openstreetmap.josm.io.IllegalDataException;
-import org.openstreetmap.josm.io.MissingOAuthAccessTokenException;
+//import org.openstreetmap.josm.io.MissingOAuthAccessTokenException;
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.io.OsmApiException;
 import org.openstreetmap.josm.io.OsmApiInitializationException;
@@ -51,6 +51,7 @@ public class ExceptionUtil {
      *
      * @param e the exception
      */
+/*
     public static String explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e) {
         e.printStackTrace();
         String msg = tr(
@@ -63,6 +64,7 @@ public class ExceptionUtil {
         );
         return msg;
     }
+*/
 
     /**
      * Explains a precondition exception when a child relation could not be deleted because
@@ -118,6 +120,7 @@ public class ExceptionUtil {
         );
     }
 
+/*
     public static String explainFailedOAuthAuthentication(OsmApiException e) {
         e.printStackTrace();
         return tr("<html>"
@@ -140,6 +143,7 @@ public class ExceptionUtil {
                 e.getAccessedUrl() == null ? tr("unknown") : e.getAccessedUrl()
         );
     }
+*/
 
     /**
      * Explains an OSM API exception because of a client timeout (HTTP 408).
--- josm.orig/build.xml
+++ josm/build.xml
@@ -107,7 +107,8 @@ Debian-Release: ${debian.version}
 
 	<target name="compile" depends="init">
 		<javac srcdir="src" classpathref="classpath" destdir="build"
-				target="1.5" source="1.5" debug="on" encoding="UTF-8">
+				target="1.5" source="1.5" debug="on" encoding="UTF-8"
+				excludes="org/openstreetmap/josm/gui/oauth/,org/openstreetmap/josm/data/oauth/">
 			<compilerarg value="-Xlint:deprecation"/>
 			<compilerarg value="-Xlint:unchecked"/>
 		</javac>
--- josm.orig/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
+++ josm/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
@@ -25,13 +25,17 @@ import javax.swing.JPanel;
 import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
+/*
 import org.openstreetmap.josm.data.oauth.OAuthParameters;
 import org.openstreetmap.josm.data.oauth.OAuthToken;
+*/
 import org.openstreetmap.josm.gui.JMultilineLabel;
 import org.openstreetmap.josm.gui.SideButton;
+/*
 import org.openstreetmap.josm.gui.oauth.AdvancedOAuthPropertiesPanel;
 import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard;
 import org.openstreetmap.josm.gui.oauth.TestAccessTokenTask;
+*/
 import org.openstreetmap.josm.io.auth.CredentialsManagerFactory;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -50,7 +54,7 @@ public class OAuthAuthenticationPreferen
     private JPanel pnlAuthorisationMessage;
     private NotYetAuthorisedPanel pnlNotYetAuthorised;
     private AlreadyAuthorisedPanel pnlAlreadyAuthorised;
-    private AdvancedOAuthPropertiesPanel pnlAdvancedProperties;
+//    private AdvancedOAuthPropertiesPanel pnlAdvancedProperties;
     private String apiUrl;
     private JCheckBox cbShowAdvancedParameters;
     private JCheckBox cbSaveToPreferences;
@@ -73,7 +77,7 @@ public class OAuthAuthenticationPreferen
         cbShowAdvancedParameters.addItemListener(
                 new ItemListener() {
                     public void itemStateChanged(ItemEvent evt) {
-                        pnlAdvancedProperties.setVisible(evt.getStateChange() == ItemEvent.SELECTED);
+//                        pnlAdvancedProperties.setVisible(evt.getStateChange() == ItemEvent.SELECTED);
                     }
                 }
         );
@@ -90,6 +94,7 @@ public class OAuthAuthenticationPreferen
         gc.fill = GridBagConstraints.BOTH;
         gc.weightx = 1.0;
         gc.weighty = 1.0;
+/*
         pnl.add(pnlAdvancedProperties = new AdvancedOAuthPropertiesPanel(), gc);
         pnlAdvancedProperties.initFromPreferences(Main.pref);
         pnlAdvancedProperties.setBorder(
@@ -99,6 +104,7 @@ public class OAuthAuthenticationPreferen
                 )
         );
         pnlAdvancedProperties.setVisible(false);
+*/
         return pnl;
     }
 
@@ -129,14 +135,15 @@ public class OAuthAuthenticationPreferen
 
     protected void refreshView() {
         pnlAuthorisationMessage.removeAll();
-        if (OAuthAccessTokenHolder.getInstance().containsAccessToken()) {
+/*        if (OAuthAccessTokenHolder.getInstance().containsAccessToken()) {
             pnlAuthorisationMessage.add(pnlAlreadyAuthorised, BorderLayout.CENTER);
             pnlAlreadyAuthorised.refreshView();
             pnlAlreadyAuthorised.revalidate();
         } else {
+*/
             pnlAuthorisationMessage.add(pnlNotYetAuthorised, BorderLayout.CENTER);
             pnlNotYetAuthorised.revalidate();
-        }
+//        }
         repaint();
     }
 
@@ -163,9 +170,11 @@ public class OAuthAuthenticationPreferen
      * Saves the current values to preferences
      */
     public void saveToPreferences() {
+/*
         OAuthAccessTokenHolder.getInstance().setSaveToPreferences(cbSaveToPreferences.isSelected());
         OAuthAccessTokenHolder.getInstance().save(Main.pref, CredentialsManagerFactory.getCredentialManager());
         pnlAdvancedProperties.getAdvancedParameters().saveToPreferences(Main.pref);
+*/
     }
 
     /**
@@ -256,7 +265,7 @@ public class OAuthAuthenticationPreferen
             gc.gridwidth = 2;
             gc.weightx = 1.0;
             add(cbSaveToPreferences = new JCheckBox(tr("Save to preferences")), gc);
-            cbSaveToPreferences.setSelected(OAuthAccessTokenHolder.getInstance().isSaveToPreferences());
+//            cbSaveToPreferences.setSelected(OAuthAccessTokenHolder.getInstance().isSaveToPreferences());
 
             // -- action buttons
             JPanel btns = new JPanel(new FlowLayout(FlowLayout.LEFT));
@@ -285,11 +294,13 @@ public class OAuthAuthenticationPreferen
         }
 
         public void refreshView() {
+/*
             String v = OAuthAccessTokenHolder.getInstance().getAccessTokenKey();
             tfAccessTokenKey.setText(v == null? "" : v);
             v = OAuthAccessTokenHolder.getInstance().getAccessTokenSecret();
             tfAccessTokenSecret.setText(v == null? "" : v);
             cbSaveToPreferences.setSelected(OAuthAccessTokenHolder.getInstance().isSaveToPreferences());
+*/
         }
 
         public AlreadyAuthorisedPanel() {
@@ -309,6 +320,7 @@ public class OAuthAuthenticationPreferen
 
         }
         public void actionPerformed(ActionEvent arg0) {
+/*
             OAuthAuthorizationWizard wizard = new OAuthAuthorizationWizard(
                     OAuthAuthenticationPreferencesPanel.this,
                     apiUrl
@@ -320,6 +332,7 @@ public class OAuthAuthenticationPreferen
             holder.setSaveToPreferences(wizard.isSaveAccessTokenToPreferences());
             pnlAdvancedProperties.setAdvancedParameters(wizard.getOAuthParameters());
             refreshView();
+*/
         }
     }
 
@@ -334,6 +347,7 @@ public class OAuthAuthenticationPreferen
 
         }
         public void actionPerformed(ActionEvent arg0) {
+/*
             OAuthAuthorizationWizard wizard = new OAuthAuthorizationWizard(
                     OAuthAuthenticationPreferencesPanel.this,
                     apiUrl
@@ -345,6 +359,7 @@ public class OAuthAuthenticationPreferen
             holder.setSaveToPreferences(wizard.isSaveAccessTokenToPreferences());
             pnlAdvancedProperties.setAdvancedParameters(wizard.getOAuthParameters());
             refreshView();
+*/
         }
     }
 
@@ -360,6 +375,7 @@ public class OAuthAuthenticationPreferen
         }
 
         public void actionPerformed(ActionEvent evt) {
+/*
             OAuthToken token = OAuthAccessTokenHolder.getInstance().getAccessToken();
             OAuthParameters parameters = OAuthParameters.createFromPreferences(Main.pref);
             TestAccessTokenTask task = new TestAccessTokenTask(
@@ -369,6 +385,7 @@ public class OAuthAuthenticationPreferen
                     token
             );
             Main.worker.submit(task);
+*/
         }
     }