Changeset 6365 in josm for trunk/src/org/openstreetmap/josm/io/auth
- Timestamp:
- 2013-11-05T01:53:15+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java
r6362 r6365 11 11 /** 12 12 * This is the default authenticator used in JOSM. It delegates lookup of credentials 13 * for the OSM API and an optional proxy server to the currently configured 14 * {@link CredentialsManager}. 15 * 13 * for the OSM API and an optional proxy server to the currently configured {@link CredentialsManager}. 14 * @since 2641 16 15 */ 17 16 public final class DefaultAuthenticator extends Authenticator { 18 17 private static DefaultAuthenticator instance; 19 18 19 /** 20 * Returns the unique instance 21 * @return The unique instance 22 */ 20 23 public static DefaultAuthenticator getInstance() { 21 24 return instance; 22 25 } 23 26 27 /** 28 * Creates the unique instance 29 */ 24 30 public static void createInstance() { 25 31 instance = new DefaultAuthenticator(); … … 33 39 34 40 /** 35 * Called by the Java http stack when either the OSM API server or a proxy requires 36 * authentication. 37 * 41 * Called by the Java HTTP stack when either the OSM API server or a proxy requires authentication. 38 42 */ 39 @Override protected PasswordAuthentication getPasswordAuthentication() { 43 @Override 44 protected PasswordAuthentication getPasswordAuthentication() { 40 45 if (!enabled) 41 46 return null; 42 47 try { 43 if (getRequestorType().equals(Authenticator.RequestorType.SERVER) ) {48 if (getRequestorType().equals(Authenticator.RequestorType.SERVER) && OsmApi.isUsingOAuth()) { 44 49 // if we are working with OAuth we don't prompt for a password 45 if (OsmApi.isUsingOAuth()) 46 return null; 50 return null; 47 51 } 48 52 boolean tried = credentialsTried.get(getRequestorType()) != null;
Note:
See TracChangeset
for help on using the changeset viewer.