Ignore:
Timestamp:
2011-12-21T23:12:59+01:00 (13 years ago)
Author:
stoecker
Message:

see #7086 - fix passing auth information to wrong server

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java

    r4249 r4690  
    1717     */
    1818    @Override
    19     public CredentialsAgentResponse getCredentials(RequestorType requestorType, boolean noSuccessWithLastResponse) throws CredentialsAgentException{
     19    public CredentialsAgentResponse getCredentials(RequestorType requestorType, String host, boolean noSuccessWithLastResponse) throws CredentialsAgentException{
    2020        if (requestorType == null)
    2121            return null;
    22         PasswordAuthentication credentials =  lookup(requestorType);
     22        PasswordAuthentication credentials =  lookup(requestorType, host);
    2323        String username = (credentials == null || credentials.getUserName() == null) ? "" : credentials.getUserName();
    2424        String password = (credentials == null || credentials.getPassword() == null) ? "" : String.valueOf(credentials.getPassword());
     
    4747            CredentialDialog dialog = null;
    4848            switch(requestorType) {
    49             case SERVER: dialog = CredentialDialog.getOsmApiCredentialDialog(username, password, getSaveUsernameAndPasswordCheckboxText()); break;
    50             case PROXY: dialog = CredentialDialog.getHttpProxyCredentialDialog(username, password, getSaveUsernameAndPasswordCheckboxText()); break;
     49            case SERVER: dialog = CredentialDialog.getOsmApiCredentialDialog(username, password, host, getSaveUsernameAndPasswordCheckboxText()); break;
     50            case PROXY: dialog = CredentialDialog.getHttpProxyCredentialDialog(username, password, host, getSaveUsernameAndPasswordCheckboxText()); break;
    5151            }
    5252            dialog.setVisible(true);
     
    5757            response.setPassword(dialog.getPassword());
    5858            if (dialog.isSaveCredentials()) {
    59                 store(requestorType, new PasswordAuthentication(
     59                store(requestorType, host, new PasswordAuthentication(
    6060                        response.getUsername(),
    6161                        response.getPassword()
Note: See TracChangeset for help on using the changeset viewer.