Changeset 8509 in josm for trunk/src/org/openstreetmap/josm/gui/oauth
- Timestamp:
- 2015-06-20T14:36:00+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/oauth
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java ¶
r8461 r8509 94 94 HtmlPanel pnlMessage = new HtmlPanel(); 95 95 HTMLEditorKit kit = (HTMLEditorKit)pnlMessage.getEditorPane().getEditorKit(); 96 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;}"); 96 kit.getStyleSheet().addRule( 97 ".warning-body {background-color:rgb(253,255,221);padding: 10pt; border-color:rgb(128,128,128);border-style: solid;border-width: 1px;}"); 97 98 kit.getStyleSheet().addRule("ol {margin-left: 1cm}"); 98 99 pnlMessage.setText("<html><body><p class=\"warning-body\">" … … 143 144 pnlMessage = new HtmlPanel(); 144 145 kit = (HTMLEditorKit)pnlMessage.getEditorPane().getEditorKit(); 145 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;}"); 146 kit.getStyleSheet().addRule( 147 ".warning-body {background-color:rgb(253,255,221);padding: 10pt; border-color:rgb(128,128,128);border-style: solid;border-width: 1px;}"); 146 148 kit.getStyleSheet().addRule("ol {margin-left: 1cm}"); 147 149 pnlMessage.setText("<html><body>" -
TabularUnified trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java ¶
r8444 r8509 427 427 } 428 428 429 protected void sendAuthorisationRequest(SessionId sessionId, OAuthToken requestToken, OsmPrivileges privileges) throws OsmOAuthAuthorizationException { 429 protected void sendAuthorisationRequest(SessionId sessionId, OAuthToken requestToken, OsmPrivileges privileges) 430 throws OsmOAuthAuthorizationException { 430 431 Map<String, String> parameters = new HashMap<>(); 431 432 fetchOAuthToken(sessionId, requestToken); … … 492 493 * 493 494 * @param requestToken the request token. Must not be null. 494 * @param osmUserName the OSM user name. Must not be null.495 * @param osmPassword the OSM password. Must not be null.495 * @param userName the OSM user name. Must not be null. 496 * @param password the OSM password. Must not be null. 496 497 * @param privileges the set of privileges. Must not be null. 497 498 * @param monitor a progress monitor. Defaults to {@link NullProgressMonitor#INSTANCE} if null … … 503 504 * @throws OsmTransferCanceledException if the task is canceled by the user 504 505 */ 505 public void authorise(OAuthToken requestToken, String osmUserName, String osmPassword, OsmPrivileges privileges, ProgressMonitor monitor) throws OsmOAuthAuthorizationException, OsmTransferCanceledException{ 506 public void authorise(OAuthToken requestToken, String userName, String password, OsmPrivileges privileges, ProgressMonitor monitor) 507 throws OsmOAuthAuthorizationException, OsmTransferCanceledException { 506 508 CheckParameterUtil.ensureParameterNotNull(requestToken, "requestToken"); 507 CheckParameterUtil.ensureParameterNotNull( osmUserName, "osmUserName");508 CheckParameterUtil.ensureParameterNotNull( osmPassword, "osmPassword");509 CheckParameterUtil.ensureParameterNotNull(userName, "userName"); 510 CheckParameterUtil.ensureParameterNotNull(password, "password"); 509 511 CheckParameterUtil.ensureParameterNotNull(privileges, "privileges"); 510 512 … … 517 519 monitor.indeterminateSubTask(tr("Initializing a session at the OSM website...")); 518 520 SessionId sessionId = fetchOsmWebsiteSessionId(); 519 sessionId.userName = osmUserName;521 sessionId.userName = userName; 520 522 if (canceled) 521 523 throw new OsmTransferCanceledException("Authorization canceled"); 522 524 monitor.worked(1); 523 525 524 monitor.indeterminateSubTask(tr("Authenticating the session for user ''{0}''...", osmUserName));525 authenticateOsmSession(sessionId, osmUserName,osmPassword);526 monitor.indeterminateSubTask(tr("Authenticating the session for user ''{0}''...", userName)); 527 authenticateOsmSession(sessionId, userName, password); 526 528 if (canceled) 527 529 throw new OsmTransferCanceledException("Authorization canceled"); -
TabularUnified trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java ¶
r7004 r8509 113 113 114 114 if (connection.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) 115 throw new OsmApiException(HttpURLConnection.HTTP_UNAUTHORIZED, tr("Retrieving user details with Access Token Key ''{0}'' was rejected.", token.getKey()), null); 115 throw new OsmApiException(HttpURLConnection.HTTP_UNAUTHORIZED, 116 tr("Retrieving user details with Access Token Key ''{0}'' was rejected.", token.getKey()), null); 116 117 117 118 if (connection.getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) 118 throw new OsmApiException(HttpURLConnection.HTTP_FORBIDDEN, tr("Retrieving user details with Access Token Key ''{0}'' was forbidden.", token.getKey()), null); 119 throw new OsmApiException(HttpURLConnection.HTTP_FORBIDDEN, 120 tr("Retrieving user details with Access Token Key ''{0}'' was forbidden.", token.getKey()), null); 119 121 120 122 if (connection.getResponseCode() != HttpURLConnection.HTTP_OK)
Note:
See TracChangeset
for help on using the changeset viewer.