summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalina Jasinska <kalina.jasinska@gmail.com>2013-08-30 08:53:50 (GMT)
committer Kalina Jasinska <kalina.jasinska@gmail.com>2013-08-30 08:53:50 (GMT)
commit958d4b58de57db98e9f43e25a26888cbb914c0a9 (patch)
treec2ca3478e7dc025dd9155b73b765a15477a73561
parent3eafd45c71fb3185a9b0ecdc636c696d4a84b3a2 (diff)
downloadQCG-Data-958d4b58de57db98e9f43e25a26888cbb914c0a9.zip
QCG-Data-958d4b58de57db98e9f43e25a26888cbb914c0a9.tar.gz
QCG-Data-958d4b58de57db98e9f43e25a26888cbb914c0a9.tar.bz2
automatic login for gsi, saving certificates passwords
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java1
5 files changed, 22 insertions, 8 deletions
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java
index 9e941e0..37b6c7a 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java
@@ -1714,7 +1714,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
IRODSAccount savedAccount = idropCore.getIrodsAccount();
idropCore.setIrodsAccount(null);
iDrop idrop = (iDrop) thisPanel.getParent();
- LoginDialog loginDialog = new LoginDialog(thisPanel, idropCore);
+ LoginDialog loginDialog = new LoginDialog(thisPanel, idropCore,false);
loginDialog.setVisible(true);
if (idropCore.getIrodsAccount() == null) {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java
index aa80d05..79facc9 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java
@@ -168,7 +168,7 @@ public class IDROPDesktop {
log.info("logging in in splash background thread");
idropSplashWindow.setStatus("Logging in...", ++count);
- final LoginDialog loginDialog = new LoginDialog(null, idropCore);
+ final LoginDialog loginDialog = new LoginDialog(null, idropCore,true);
Toolkit tk = idrop.getToolkit();
int x = (tk.getScreenSize().width - loginDialog.getWidth()) / 2;
int y = (tk.getScreenSize().height - loginDialog.getHeight()) / 2;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
index fc601a8..d45d35c 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
@@ -63,8 +63,12 @@ public class LoginDialog extends JDialog {
static final int BROWSER_MODE = 3;
static final int PROXY_MODE = 4;
- public LoginDialog(final JDialog parentDialog, final IDROPCore idropCore) {
+ boolean tryToLogin;
+
+ public LoginDialog(final JDialog parentDialog, final IDROPCore idropCore, boolean tryToLogin) {
super(parentDialog, true);
+ this.tryToLogin = tryToLogin;
+
if (idropCore == null) {
throw new IllegalArgumentException("null idropCore");
}
@@ -79,7 +83,7 @@ public class LoginDialog extends JDialog {
registerKeystrokeListener();
setLocationRelativeTo(parentDialog);
-
+
}
private void loginNormally() {
@@ -178,7 +182,11 @@ public class LoginDialog extends JDialog {
password.setText(savedPassword);
chkRememberPass.setSelected(true);
- loginTrialSuccesful = !processLogin();
+ String certPassword = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_CERT_PASSWORD);
+ certpass.setText(certPassword);
+ if(tryToLogin){
+ loginTrialSuccesful = !processLogin();
+ }
}
}
@@ -363,12 +371,17 @@ public class LoginDialog extends JDialog {
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD,
irodsAccount.getPassword());
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS,
- "true");
+ "true");
+
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_PASSWORD,
+ certpass.getText());
}else{
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD,
"");
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS,
- "false");
+ "false");
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_PASSWORD,
+ "");
}
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_PROXY_LOCATION, txtProxy.getText());
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERTIFICATES_LOCATION, txtCerts.getText());
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
index 146ed9d..3f01583 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
@@ -166,7 +166,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
IRODSAccount savedAccount = iDropCore.getIrodsAccount();
iDropCore.setIrodsAccount(null);
- LoginDialog loginDialog = new LoginDialog(null, iDropCore);
+ LoginDialog loginDialog = new LoginDialog(null, iDropCore,false);
loginDialog.setLocationRelativeTo(null);
loginDialog.setVisible(true);
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
index d9251fd..a9e49f9 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
@@ -44,6 +44,7 @@ public interface IdropConfigurationService {
public static final String ACCOUNT_CACHE_CERT_PEM_LOCATION = "irods.account.gsi.cert.pem.location";
public static final String ACCOUNT_CACHE_KEY_PEM_LOCATION = "irods.account.gsi.key.pem.location";
public static final String ACCOUNT_CACHE_CERT_P12_LOCATION = "irods.account.gsi.cert.p12.location";
+ public static final String ACCOUNT_CACHE_CERT_PASSWORD = "irods.account.gsi.cert.password";
public static final String ACCOUNT_CACHE_CERT_LOGIN_MODE = "irods.account.gsi.cert.login.mode";
// /for GSI
public static final String POLICY_AWARE_PROPERTY = "policy.aware";