summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgosiaw <magnolia1973@gazeta.pl>2013-10-07 10:36:02 (GMT)
committer gosiaw <magnolia1973@gazeta.pl>2013-10-07 10:36:02 (GMT)
commit4136c5e284313f71075f130916ffafadaff322c7 (patch)
tree3cb75c90eee81d751cd4b07a1d3ee4201ec29dcc
parentd4c63c51c9d5f28162b368f41476a5c2207e4808 (diff)
downloadQCG-Data-4136c5e284313f71075f130916ffafadaff322c7.zip
QCG-Data-4136c5e284313f71075f130916ffafadaff322c7.tar.gz
QCG-Data-4136c5e284313f71075f130916ffafadaff322c7.tar.bz2
Recovering Kalina's changes
-rw-r--r--idrop-swing/pom.xml6
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java14
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java1097
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java13
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java2
5 files changed, 775 insertions, 357 deletions
diff --git a/idrop-swing/pom.xml b/idrop-swing/pom.xml
index 996239c..4827e8a 100644
--- a/idrop-swing/pom.xml
+++ b/idrop-swing/pom.xml
@@ -112,6 +112,12 @@
<artifactId>libbrowser</artifactId>
<version>1</version>
</dependency>
+ <dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jsch</artifactId>
+ <version>0.1.27</version>
+ <type>jar</type>
+ </dependency>
</dependencies>
<build>
<plugins>
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 37b6c7a..85b5010 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
@@ -92,6 +92,20 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
}
});
+ // default value of publicLinkService url
+ String publicLinkDef = "http://elder10.man.poznan.pl:8080/gdrop-web/register";
+ String publicLinkAddress = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.IDROP_PUBLIC_LINK_SERVICE);
+ if(publicLinkAddress == null){
+ publicLinkAddress = publicLinkDef;
+ }
+ txtPublicLinks.setText(publicLinkAddress);
+ try {
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IDROP_PUBLIC_LINK_SERVICE, txtPublicLinks.getText());
+ } catch (IdropException ex) {
+ log.error("Error saving public link service url.",ex);
+ }
+
+
pnlConfigPublicLinks.add(txtPublicLinks);
tabConfig.addTab("Public links", pnlConfigPublicLinks);
}
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 d45d35c..bf5e687 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
@@ -34,14 +34,21 @@ import org.irods.jargon.core.connection.auth.AuthResponse;
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.IRODSFileSystem;
import org.irods.jargon.idrop.desktop.systraygui.gss.CertificateConverter;
-import org.irods.jargon.idrop.desktop.systraygui.gss.GssSecurityException;
import org.irods.jargon.idrop.desktop.systraygui.gss.GssUtil;
+import org.irods.jargon.idrop.desktop.systraygui.gss.ZipFileExtractor;
import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationService;
import org.irods.jargon.idrop.desktop.systraygui.utils.IdropPropertiesHelper;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
import org.slf4j.LoggerFactory;
import uk.ac.rl.esc.browser.Browser;
+import com.jcraft.jsch.Channel;
+import com.jcraft.jsch.ChannelExec;
+import com.jcraft.jsch.ChannelSftp;
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.SftpException;
+import java.io.InputStream;
/**
*
@@ -58,23 +65,33 @@ public class LoginDialog extends JDialog {
return loginTrialSuccesful;
}
// Indexes of gsi modes used in properties to store users choice
+ static final int NO_CERTIFICATE_MODE = 0;
static final int PEM_MODE = 1;
static final int P12_MODE = 2;
static final int BROWSER_MODE = 3;
static final int PROXY_MODE = 4;
-
+ static final int KEYFS_MODE = 5;
+ // default certificates location
+ static String IDROP_HOME = "";
+ static String DEFAULT_CA_FILES_NAME = "/certificates";
+ static final String CA_ZIP_FILE_PATH = "certificates.zip";//zip?
+ boolean CAfilesConfigured = false;
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");
}
this.idropCore = idropCore;
initComponents();
+ // set needed variables
+ IDROP_HOME = deriveConfigHomeDirectory();
+ CAfilesConfigured = configureCAFiles();
+
if (idropCore.getIdropConfig().isLoginPreset()) {
loginUsingPreset();
} else {
@@ -83,7 +100,52 @@ public class LoginDialog extends JDialog {
registerKeystrokeListener();
setLocationRelativeTo(parentDialog);
-
+
+ }
+ //construct path to idrop home
+
+ private String deriveConfigHomeDirectory() {
+ String userHomeDirectory = System.getProperty("user.home");
+ userHomeDirectory = userHomeDirectory.replaceAll("\\\\", "/");
+ StringBuilder sb = new StringBuilder();
+ sb.append(userHomeDirectory);
+ sb.append("/.idrop");
+ String derivedConfigHomeDirectory = sb.toString();
+ return derivedConfigHomeDirectory;
+ }
+ /*
+ * Extracts certificates from package inside idrop jar to default location
+ */
+
+ private boolean configureCAFiles() {
+ File caDir = new File(IDROP_HOME + DEFAULT_CA_FILES_NAME);
+
+ if (caDir.exists() && (!caDir.canRead() || !caDir.canWrite())) {
+ log.debug("Do not have sufficient read & write permissions CA certificates directory: " + IDROP_HOME + DEFAULT_CA_FILES_NAME);
+ return false;
+ }
+
+ if (!caDir.exists()) {
+ log.info("Trying to create " + IDROP_HOME + DEFAULT_CA_FILES_NAME);
+ if (caDir.mkdir()) {
+ log.info(caDir.getPath() + " created");
+ } else {
+ log.error("Unable to make CA certificates directory: " + IDROP_HOME + DEFAULT_CA_FILES_NAME);
+ }
+ }
+ try {
+ String dest = IDROP_HOME + DEFAULT_CA_FILES_NAME + ".zip";
+ ZipFileExtractor.unzipFile(LoginDialog.class.getClassLoader(), CA_ZIP_FILE_PATH, dest);
+ txtCerts.setText(dest);
+ } catch (Exception e) {
+
+ if (caDir.exists() && (caDir.list().length == 0)) {
+ caDir.delete();
+ log.debug("Empty certificates dir deleted.");
+ return false;
+ }
+ }
+ return true;
}
private void loginNormally() {
@@ -117,6 +179,9 @@ public class LoginDialog extends JDialog {
if (certificates != null) {
txtCerts.setText(certificates);
+ } else if (CAfilesConfigured) {
+ // if no diferent location was set - set default one
+ txtCerts.setText(IDROP_HOME + DEFAULT_CA_FILES_NAME);
}
// Read paths from propeties: PEM certificate, PEM key, p12 certificate
@@ -134,15 +199,7 @@ public class LoginDialog extends JDialog {
if (keyLoc != null) {
txtKeyLocation.setText(keyLoc);
}
- // Read gsi mode from properties (p12, PEM, browser, proxy file)
- String certMode = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_CERT_LOGIN_MODE);
- try {
- int certModeNum = Integer.parseInt(certMode);
- setSelectedModeFields(certModeNum);
- } catch (Exception ex) {
- Logger.getLogger(LoginDialog.class.getName()).log(Level.WARNING, null, ex);
- }
- //
+
txtPort.setText(port);
String zone = idropCore.getIdropConfig().getPropertyForKey(
IdropConfigurationService.ACCOUNT_CACHE_ZONE);
@@ -154,40 +211,55 @@ public class LoginDialog extends JDialog {
IdropConfigurationService.ACCOUNT_CACHE_USER_NAME);
txtUserName.setText(username);
-
+ String plgridusername = idropCore.getIdropConfig().getPropertyForKey(
+ IdropConfigurationService.ACCOUNT_CACHE_PLGRID_USERNAME);
+ txtPLGRIDUserName.setText(plgridusername);
+
String save = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS);
boolean saveP = "true".equals(save);
- boolean autoGsi = false;
- String gsi = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_USER_AUTO_GSI);
- autoGsi = "true".equals(gsi);
-
- hideAdvancedViewFields();
- hideProxyLoginFields();
-
- if(autoGsi){
- hideNormalLoginFields();
- showProxyLoginFields();
- chkProxyLogin.setSelected(true);
- String gsiMode = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_CERT_LOGIN_MODE);
- try{
- int gsiModeNum = Integer.parseInt(gsiMode);
- setSelectedModeFields(gsiModeNum);
- showProxyChoosenModeFields();
- }catch(Exception e){
- }
+
+ String loginTypeMode = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_LOGIN_TYPE);
+ try {
+ int modeNum = Integer.parseInt(loginTypeMode);
+ setSelectedModeFields(modeNum);
+ showChoosenModeFields();
+ } catch (Exception e) {
+ setSelectedModeFields(NO_CERTIFICATE_MODE);
+ showChoosenModeFields();
}
-
+
if (saveP) {
String savedPassword = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD);
password.setText(savedPassword);
chkRememberPass.setSelected(true);
-
- String certPassword = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_CERT_PASSWORD);
- certpass.setText(certPassword);
- if(tryToLogin){
+
+ String certp12Password = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_CERT_P12_PASSWORD);
+ certpassP12.setText(certp12Password);
+
+ String certPemPassword = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_CERT_PEM_PASSWORD);
+ certpassPEM.setText(certPemPassword);
+
+ String plgpassword = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_PLGRID_PASSWORD);
+ String plgkeypassword = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_PLGRID_KEY_PASSWORD);
+ plgridpass.setText(plgpassword);
+ ldapKeyPassword.setText(plgkeypassword);
+
+ if (tryToLogin) {
loginTrialSuccesful = !processLogin();
}
}
+ hideAdvancedViewFields();
+ //if location not set - show field to set it
+/* if (!CAfilesConfigured || txtCerts.getText() == null || "".equals(txtCerts.getText())) {
+ txtCerts.setVisible(true);
+ lblCerts.setVisible(true);
+ btnCerts.setVisible(true);
+ }
+*/
+ // hide unused components
+ comboLoginMode.setVisible(false);
+ lblLoginMode.setVisible(false);
+ chkGuestLogin.setVisible(false);
}
private void loginUsingPreset() {
@@ -276,14 +348,17 @@ public class LoginDialog extends JDialog {
sb.append("/home/");
sb.append(txtUserName.getText());
- if (chkGuestLogin.isSelected()) {
- irodsAccount = IRODSAccount.instanceForAnonymous(
- presetHost, presetPort, "", presetZone,
- presetResource);
- } else if (chkProxyLogin.isSelected()) {
+// if (chkGuestLogin.isSelected()) {
+// irodsAccount = IRODSAccount.instanceForAnonymous(
+// presetHost, presetPort, "", presetZone,
+// presetResource);
+// } else
+ if (comboLoginType.getSelectedIndex() != NO_CERTIFICATE_MODE) {
GSSCredential gssCred = getGssCredential();
-
+ if (gssCred == null) {
+ throw new Exception();
+ }
GSIIRODSAccount acc = GSIIRODSAccount.instance(presetHost, presetPort, gssCred, presetResource);
acc.setCertificateAuthority(txtCerts.getText());
irodsAccount = acc;
@@ -299,15 +374,18 @@ public class LoginDialog extends JDialog {
sb.append("/home/");
sb.append(txtUserName.getText());
- if (chkGuestLogin.isSelected()) {
- irodsAccount = IRODSAccount.instanceForAnonymous(txtHost
- .getText().trim(), Integer.parseInt(txtPort
- .getText().trim()), "", txtZone.getText().trim(),
- txtResource.getText().trim());
- } else if (chkProxyLogin.isSelected()) {
+// if (chkGuestLogin.isSelected()) {
+// irodsAccount = IRODSAccount.instanceForAnonymous(txtHost
+// .getText().trim(), Integer.parseInt(txtPort
+// .getText().trim()), "", txtZone.getText().trim(),
+// txtResource.getText().trim());
+// } else
+ if (comboLoginType.getSelectedIndex() != NO_CERTIFICATE_MODE) {
// TODO
GSSCredential gssCred = getGssCredential();
-
+ if (gssCred == null) {
+ throw new Exception();
+ }
GSIIRODSAccount acc = GSIIRODSAccount.instance(
txtHost.getText().trim(),
@@ -339,8 +417,8 @@ public class LoginDialog extends JDialog {
Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE, null, ex);
MessageManager.showError(this, ex.getMessage(), MessageManager.TITLE_MESSAGE);
return true;
- } catch (GssSecurityException ex) {//?
- Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (Exception ex) {//?
+ Logger.getLogger(LoginDialog.class.getName()).log(Level.WARNING, null, ex);
MessageManager.showError(this,
"Wrong certifcate, key, password or proxy.",
"Login Error");
@@ -367,38 +445,46 @@ public class LoginDialog extends JDialog {
.getAuthenticatedIRODSAccount());
try {
idropCore.getIdropConfigurationService().saveLogin(irodsAccount);
- if(chkRememberPass.isSelected()){
+ if (chkRememberPass.isSelected()) {
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD,
+ irodsAccount.getPassword());
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS,
+ "true");
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_P12_PASSWORD,
+ new String(certpassP12.getPassword()));
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_PEM_PASSWORD,
+ new String(certpassPEM.getPassword()));
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_PLGRID_PASSWORD,
+ new String(plgridpass.getPassword()));
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_PLGRID_KEY_PASSWORD,
+ new String(ldapKeyPassword.getPassword()));
+ } else {
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD,
- irodsAccount.getPassword());
+ "");
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS,
- "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");
- idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_PASSWORD,
- "");
+ "false");
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_P12_PASSWORD,
+ "");
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_PEM_PASSWORD,
+ "");
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_PLGRID_PASSWORD,
+ "");
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_PLGRID_KEY_PASSWORD,
+ "");
}
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_PROXY_LOCATION, txtProxy.getText());
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERTIFICATES_LOCATION, txtCerts.getText());
- if (chkProxyLogin.isSelected()) {
- idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_AUTO_GSI, "true");
- idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_LOGIN_MODE, "" + getSelectedModeFieldNum());
- } else {
- idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_AUTO_GSI, "false");
- idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_LOGIN_MODE, "-1");
- }
-
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_LOGIN_TYPE, "" + getSelectedModeFieldNum());
+
// Save in properties: paths to certificates, key and gsi mode
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_PEM_LOCATION, txtPEMCertificateLocation.getText());
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_KEY_PEM_LOCATION, txtKeyLocation.getText());
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_P12_LOCATION, txtP12CertificateLocation.getText());
-
+
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_PLGRID_USERNAME,
+ txtPLGRIDUserName.getText());
+
//todo save proxy path and certificates location
} catch (IdropException ex) {
@@ -498,7 +584,6 @@ public class LoginDialog extends JDialog {
jPanel1 = new javax.swing.JPanel();
chkAdvancedLogin = new javax.swing.JCheckBox();
chkGuestLogin = new javax.swing.JCheckBox();
- chkProxyLogin = new javax.swing.JCheckBox();
lblLoginMode = new javax.swing.JLabel();
comboLoginMode = new javax.swing.JComboBox();
lblProxy = new javax.swing.JLabel();
@@ -507,20 +592,15 @@ public class LoginDialog extends JDialog {
txtCerts = new javax.swing.JTextField();
btnProxy = new javax.swing.JButton();
btnCerts = new javax.swing.JButton();
- lblCertMode = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
- btnProxyCertKeyPair = new javax.swing.JRadioButton();
- btnProxyP12 = new javax.swing.JRadioButton();
- btnProxyBrowser = new javax.swing.JRadioButton();
- btnProxyFile = new javax.swing.JRadioButton();
txtKeyLocation = new javax.swing.JTextField();
lblKeyLocation = new javax.swing.JLabel();
btnKeyLocation = new javax.swing.JButton();
lblP12CertificateLocation = new javax.swing.JLabel();
txtP12CertificateLocation = new javax.swing.JTextField();
btnP12CertificateLocation = new javax.swing.JButton();
- lblCertPass = new javax.swing.JLabel();
- certpass = new javax.swing.JPasswordField();
+ lblCertPassP12 = new javax.swing.JLabel();
+ certpassP12 = new javax.swing.JPasswordField();
lblPEMCertificateLocation = new javax.swing.JLabel();
txtPEMCertificateLocation = new javax.swing.JTextField();
btnPEMCertificateLocation = new javax.swing.JButton();
@@ -531,6 +611,18 @@ public class LoginDialog extends JDialog {
lbllCertCombo = new javax.swing.JLabel();
cmbCertificates = new javax.swing.JComboBox();
btnCheckCertsInBrowser = new javax.swing.JButton();
+ lblCertPassPEM = new javax.swing.JLabel();
+ certpassPEM = new javax.swing.JPasswordField();
+ lblLdapKeyPass = new javax.swing.JLabel();
+ ldapKeyPassword = new javax.swing.JPasswordField();
+ lblPLGRIDUserName = new javax.swing.JLabel();
+ txtPLGRIDUserName = new javax.swing.JTextField();
+ lblplgridpass = new javax.swing.JLabel();
+ plgridpass = new javax.swing.JPasswordField();
+ txtKeyfsLifetime = new javax.swing.JTextField();
+ lblKeyfsLifetime = new javax.swing.JLabel();
+ lblLoginType = new javax.swing.JLabel();
+ comboLoginType = new javax.swing.JComboBox();
pnlToolbar = new javax.swing.JPanel();
chkRememberPass = new javax.swing.JCheckBox();
btnOK = new javax.swing.JButton();
@@ -539,48 +631,64 @@ public class LoginDialog extends JDialog {
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ pnlLoginInfo.setMinimumSize(new java.awt.Dimension(600, 300));
+ pnlLoginInfo.setPreferredSize(new java.awt.Dimension(600, 300));
pnlLoginInfo.setLayout(new java.awt.GridBagLayout());
+ lblHost.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
lblHost.setText("Host:");
+ lblHost.setAlignmentX(1.0F);
lblHost.setMaximumSize(new java.awt.Dimension(40, 14));
lblHost.setMinimumSize(new java.awt.Dimension(30, 14));
lblHost.setPreferredSize(null);
lblHost.setRequestFocusEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ gridBagConstraints.gridy = 15;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblHost, gridBagConstraints);
txtHost.setColumns(30);
- txtHost.setPreferredSize(null);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 1;
+ gridBagConstraints.gridy = 15;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(txtHost, gridBagConstraints);
+ lblPort.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
lblPort.setText("Port:");
+ lblPort.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 2;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ gridBagConstraints.gridy = 16;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblPort, gridBagConstraints);
txtPort.setColumns(30);
txtPort.setText("1247");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 2;
+ gridBagConstraints.gridy = 16;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(txtPort, gridBagConstraints);
+ lblZone.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
lblZone.setText("Zone:");
+ lblZone.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 3;
+ gridBagConstraints.gridy = 17;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblZone, gridBagConstraints);
@@ -588,30 +696,42 @@ public class LoginDialog extends JDialog {
txtZone.setPreferredSize(null);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 3;
+ gridBagConstraints.gridy = 17;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(txtZone, gridBagConstraints);
+ lblResource.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
lblResource.setText("Resource:");
+ lblResource.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 4;
+ gridBagConstraints.gridy = 18;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblResource, gridBagConstraints);
txtResource.setColumns(30);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 4;
+ gridBagConstraints.gridy = 18;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(txtResource, gridBagConstraints);
- lblUserName.setText("User Name:");
+ lblUserName.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblUserName.setText("User name:");
+ lblUserName.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 5;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblUserName, gridBagConstraints);
@@ -619,15 +739,21 @@ public class LoginDialog extends JDialog {
txtUserName.setPreferredSize(null);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 5;
+ gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(txtUserName, gridBagConstraints);
+ lblPassword.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
lblPassword.setText("Password:");
+ lblPassword.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 6;
+ gridBagConstraints.gridy = 3;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblPassword, gridBagConstraints);
@@ -635,9 +761,12 @@ public class LoginDialog extends JDialog {
password.setPreferredSize(null);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 6;
+ gridBagConstraints.gridy = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(password, gridBagConstraints);
chkAdvancedLogin.setText("Advanced Login Settings");
@@ -657,24 +786,18 @@ public class LoginDialog extends JDialog {
});
jPanel1.add(chkGuestLogin);
- chkProxyLogin.setText("Use GSI");
- chkProxyLogin.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- chkProxyLoginActionPerformed(evt);
- }
- });
- jPanel1.add(chkProxyLogin);
-
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 17;
+ gridBagConstraints.gridy = 23;
pnlLoginInfo.add(jPanel1, gridBagConstraints);
- lblLoginMode.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
- lblLoginMode.setText("Login Mode:");
+ lblLoginMode.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblLoginMode.setText("Login mode:");
+ lblLoginMode.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 16;
+ gridBagConstraints.gridy = 22;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblLoginMode, gridBagConstraints);
@@ -682,33 +805,49 @@ public class LoginDialog extends JDialog {
comboLoginMode.setToolTipText("Authentication mode used at login");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 16;
+ gridBagConstraints.gridy = 22;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(comboLoginMode, gridBagConstraints);
+ lblProxy.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
lblProxy.setText("Proxy location:");
+ lblProxy.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 9;
+ gridBagConstraints.gridy = 21;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblProxy, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 9;
+ gridBagConstraints.gridy = 21;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(txtProxy, gridBagConstraints);
- lblCerts.setText("Certificates location:");
+ lblCerts.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblCerts.setText("CA certificates:");
+ lblCerts.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 11;
+ gridBagConstraints.gridy = 20;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblCerts, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 11;
+ gridBagConstraints.gridy = 20;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(txtCerts, gridBagConstraints);
btnProxy.setText("Choose...");
@@ -719,7 +858,8 @@ public class LoginDialog extends JDialog {
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
- gridBagConstraints.gridy = 9;
+ gridBagConstraints.gridy = 21;
+ gridBagConstraints.ipadx = 1;
pnlLoginInfo.add(btnProxy, gridBagConstraints);
btnCerts.setText("Choose...");
@@ -730,62 +870,27 @@ public class LoginDialog extends JDialog {
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
- gridBagConstraints.gridy = 11;
+ gridBagConstraints.gridy = 20;
+ gridBagConstraints.ipadx = 1;
pnlLoginInfo.add(btnCerts, gridBagConstraints);
-
- lblCertMode.setText("Certificate mode:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
- pnlLoginInfo.add(lblCertMode, gridBagConstraints);
-
- btngrpProxySource.add(btnProxyCertKeyPair);
- btnProxyCertKeyPair.setText("cert/key pair");
- btnProxyCertKeyPair.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnProxyCertKeyPairActionPerformed(evt);
- }
- });
- jPanel2.add(btnProxyCertKeyPair);
-
- btngrpProxySource.add(btnProxyP12);
- btnProxyP12.setText("p12 certificate");
- btnProxyP12.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnProxyP12ActionPerformed(evt);
- }
- });
- jPanel2.add(btnProxyP12);
-
- btngrpProxySource.add(btnProxyBrowser);
- btnProxyBrowser.setText("certificate in browser");
- btnProxyBrowser.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnProxyBrowserActionPerformed(evt);
- }
- });
- jPanel2.add(btnProxyBrowser);
-
- btngrpProxySource.add(btnProxyFile);
- btnProxyFile.setText("proxy file");
- btnProxyFile.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnProxyFileActionPerformed(evt);
- }
- });
- jPanel2.add(btnProxyFile);
-
pnlLoginInfo.add(jPanel2, new java.awt.GridBagConstraints());
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 10;
+ gridBagConstraints.gridy = 7;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(txtKeyLocation, gridBagConstraints);
- lblKeyLocation.setText("Key location:");
+ lblKeyLocation.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblKeyLocation.setText("Key:");
+ lblKeyLocation.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 10;
+ gridBagConstraints.gridy = 7;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblKeyLocation, gridBagConstraints);
@@ -797,19 +902,28 @@ public class LoginDialog extends JDialog {
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
- gridBagConstraints.gridy = 10;
+ gridBagConstraints.gridy = 7;
+ gridBagConstraints.ipadx = 1;
pnlLoginInfo.add(btnKeyLocation, gridBagConstraints);
- lblP12CertificateLocation.setText("P12 Certificate location:");
+ lblP12CertificateLocation.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblP12CertificateLocation.setText("Certificate:");
+ lblP12CertificateLocation.setToolTipText("");
+ lblP12CertificateLocation.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 7;
+ gridBagConstraints.gridy = 4;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblP12CertificateLocation, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 7;
+ gridBagConstraints.gridy = 4;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(txtP12CertificateLocation, gridBagConstraints);
btnP12CertificateLocation.setText("Choose...");
@@ -820,35 +934,49 @@ public class LoginDialog extends JDialog {
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
- gridBagConstraints.gridy = 7;
+ gridBagConstraints.gridy = 4;
+ gridBagConstraints.ipadx = 1;
pnlLoginInfo.add(btnP12CertificateLocation, gridBagConstraints);
- lblCertPass.setText("Certificate password:");
+ lblCertPassP12.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblCertPassP12.setText("Password:");
+ lblCertPassP12.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 12;
+ gridBagConstraints.gridy = 5;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
- pnlLoginInfo.add(lblCertPass, gridBagConstraints);
+ pnlLoginInfo.add(lblCertPassP12, gridBagConstraints);
- certpass.setColumns(30);
- certpass.setPreferredSize(null);
+ certpassP12.setColumns(30);
+ certpassP12.setPreferredSize(null);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 12;
+ gridBagConstraints.gridy = 5;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(certpass, gridBagConstraints);
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
+ pnlLoginInfo.add(certpassP12, gridBagConstraints);
- lblPEMCertificateLocation.setText("PEM Certificate location:");
+ lblPEMCertificateLocation.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblPEMCertificateLocation.setText("Certificate:");
+ lblPEMCertificateLocation.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 8;
+ gridBagConstraints.gridy = 6;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblPEMCertificateLocation, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 8;
+ gridBagConstraints.gridy = 6;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(txtPEMCertificateLocation, gridBagConstraints);
btnPEMCertificateLocation.setText("Choose...");
@@ -859,13 +987,17 @@ public class LoginDialog extends JDialog {
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
- gridBagConstraints.gridy = 8;
+ gridBagConstraints.gridy = 6;
+ gridBagConstraints.ipadx = 1;
pnlLoginInfo.add(btnPEMCertificateLocation, gridBagConstraints);
+ lbllBrowserCombo.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
lbllBrowserCombo.setText("Selected browser:");
+ lbllBrowserCombo.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 13;
+ gridBagConstraints.gridy = 9;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lbllBrowserCombo, gridBagConstraints);
@@ -873,15 +1005,21 @@ public class LoginDialog extends JDialog {
browserpass.setPreferredSize(null);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 14;
+ gridBagConstraints.gridy = 10;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(browserpass, gridBagConstraints);
+ lblBrowserPass.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
lblBrowserPass.setText("Browser password:");
+ lblBrowserPass.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 14;
+ gridBagConstraints.gridy = 10;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lblBrowserPass, gridBagConstraints);
@@ -893,14 +1031,20 @@ public class LoginDialog extends JDialog {
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 13;
+ gridBagConstraints.gridy = 9;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(cmbBrowsers, gridBagConstraints);
+ lbllCertCombo.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
lbllCertCombo.setText("Selected certificate:");
+ lbllCertCombo.setAlignmentX(1.0F);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 15;
+ gridBagConstraints.gridy = 11;
+ gridBagConstraints.ipadx = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
pnlLoginInfo.add(lbllCertCombo, gridBagConstraints);
@@ -912,11 +1056,17 @@ public class LoginDialog extends JDialog {
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 15;
+ gridBagConstraints.gridy = 11;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
pnlLoginInfo.add(cmbCertificates, gridBagConstraints);
btnCheckCertsInBrowser.setText("Access...");
+ btnCheckCertsInBrowser.setMaximumSize(new java.awt.Dimension(81, 23));
+ btnCheckCertsInBrowser.setMinimumSize(new java.awt.Dimension(81, 23));
+ btnCheckCertsInBrowser.setPreferredSize(new java.awt.Dimension(81, 23));
btnCheckCertsInBrowser.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCheckCertsInBrowserActionPerformed(evt);
@@ -924,9 +1074,149 @@ public class LoginDialog extends JDialog {
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
- gridBagConstraints.gridy = 14;
+ gridBagConstraints.gridy = 10;
+ gridBagConstraints.ipadx = 1;
pnlLoginInfo.add(btnCheckCertsInBrowser, gridBagConstraints);
+ lblCertPassPEM.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblCertPassPEM.setText("Password:");
+ lblCertPassPEM.setAlignmentX(1.0F);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 8;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblCertPassPEM, gridBagConstraints);
+
+ certpassPEM.setColumns(30);
+ certpassPEM.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 8;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
+ pnlLoginInfo.add(certpassPEM, gridBagConstraints);
+
+ lblLdapKeyPass.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblLdapKeyPass.setText("Key password:");
+ lblLdapKeyPass.setAlignmentX(1.0F);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 14;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblLdapKeyPass, gridBagConstraints);
+
+ ldapKeyPassword.setColumns(30);
+ ldapKeyPassword.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 14;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
+ pnlLoginInfo.add(ldapKeyPassword, gridBagConstraints);
+
+ lblPLGRIDUserName.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblPLGRIDUserName.setText("PLGRID user name:");
+ lblPLGRIDUserName.setToolTipText("");
+ lblPLGRIDUserName.setAlignmentX(1.0F);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 12;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblPLGRIDUserName, gridBagConstraints);
+
+ txtPLGRIDUserName.setColumns(30);
+ txtPLGRIDUserName.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 12;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
+ pnlLoginInfo.add(txtPLGRIDUserName, gridBagConstraints);
+
+ lblplgridpass.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblplgridpass.setText("PLGRID password:");
+ lblplgridpass.setAlignmentX(1.0F);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 13;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblplgridpass, gridBagConstraints);
+
+ plgridpass.setColumns(30);
+ plgridpass.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 13;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
+ pnlLoginInfo.add(plgridpass, gridBagConstraints);
+
+ txtKeyfsLifetime.setColumns(30);
+ txtKeyfsLifetime.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 19;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
+ pnlLoginInfo.add(txtKeyfsLifetime, gridBagConstraints);
+
+ lblKeyfsLifetime.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblKeyfsLifetime.setText("Proxy lifetime (hours):");
+ lblKeyfsLifetime.setToolTipText("");
+ lblKeyfsLifetime.setAlignmentX(1.0F);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 19;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblKeyfsLifetime, gridBagConstraints);
+
+ lblLoginType.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ lblLoginType.setText("Login type:");
+ lblLoginType.setAlignmentX(1.0F);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblLoginType, gridBagConstraints);
+
+ comboLoginType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Login/password", "PEM certificate and key", "P12 certificate", "Browser keystore", "Proxy file", "PLGRID KeyFS" }));
+ comboLoginType.setToolTipText("Authentication mode used at login");
+ comboLoginType.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ comboLoginTypeActionPerformed(evt);
+ }
+ });
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.ipadx = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
+ pnlLoginInfo.add(comboLoginType, gridBagConstraints);
+
getContentPane().add(pnlLoginInfo, java.awt.BorderLayout.CENTER);
pnlToolbar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT, 2, 5));
@@ -962,7 +1252,7 @@ public class LoginDialog extends JDialog {
getContentPane().add(pnlToolbar, java.awt.BorderLayout.SOUTH);
- lblLogin.setText("Please log in to your iDrop data grid");
+ lblLogin.setText("Please log in to your QCG-Data grid");
getContentPane().add(lblLogin, java.awt.BorderLayout.PAGE_START);
pack();
@@ -972,21 +1262,6 @@ public class LoginDialog extends JDialog {
// TODO add your handling code here:
}//GEN-LAST:event_chkRememberPassActionPerformed
- private void chkProxyLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkProxyLoginActionPerformed
- if (chkProxyLogin.isSelected()) {
- chkGuestLogin.setSelected(false);
- //hide username/pass
- hideForGuestLogin();
- showProxyLoginFields();
- //Shows proper fields for choosen gsi mode (p12/pem/browser/proxy file)
- showProxyChoosenModeFields();
- } else {
- //show username/password
- showWhenGuestLogin();
- hideProxyLoginFields();
- }
- }//GEN-LAST:event_chkProxyLoginActionPerformed
-
private void btnProxyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProxyActionPerformed
final JFileChooser chooser = new JFileChooser();
chooser.setFileHidingEnabled(false);
@@ -1026,39 +1301,6 @@ public class LoginDialog extends JDialog {
}
}//GEN-LAST:event_btnP12CertificateLocationActionPerformed
- private void btnProxyCertKeyPairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProxyCertKeyPairActionPerformed
-// show proper fields when using PEM pair to authenticate user
- hideCertP12Fields();
- hideCertInBrowserFields();
- hideProxyFileFields();
- showCertKeyPairFields();
- }//GEN-LAST:event_btnProxyCertKeyPairActionPerformed
-
- private void btnProxyP12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProxyP12ActionPerformed
-// show proper fields when using p12 certificate to authenticate user
- hideCertKeyPairFields();
- hideCertInBrowserFields();
- hideProxyFileFields();
- showCertP12Fields();
- }//GEN-LAST:event_btnProxyP12ActionPerformed
-
- private void btnProxyBrowserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProxyBrowserActionPerformed
-// show proper fields when using credentials from browser to authenticate user
- hideCertKeyPairFields();
- hideCertP12Fields();
- hideProxyFileFields();
- showCertInBrowserFields();
- fillBrowserComboBox();
- }//GEN-LAST:event_btnProxyBrowserActionPerformed
-
- private void btnProxyFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProxyFileActionPerformed
-// show proper fields when using proxy file to authenticate user
- hideCertKeyPairFields();
- hideCertP12Fields();
- hideCertInBrowserFields();
- showProxyFileFields();
- }//GEN-LAST:event_btnProxyFileActionPerformed
-
private void btnPEMCertificateLocationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPEMCertificateLocationActionPerformed
//get path of certificate file when using PEM pair to authenticate user
final JFileChooser chooser = new JFileChooser();
@@ -1083,6 +1325,10 @@ public class LoginDialog extends JDialog {
}
}//GEN-LAST:event_btnCheckCertsInBrowserActionPerformed
+ private void comboLoginTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboLoginTypeActionPerformed
+ showChoosenModeFields();
+ }//GEN-LAST:event_comboLoginTypeActionPerformed
+
private void chkAdvancedLoginActionPerformed(
final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_chkAdvancedLoginActionPerformed
// TODO add your handling code here:
@@ -1095,14 +1341,14 @@ public class LoginDialog extends JDialog {
private void chkGuestLoginActionPerformed(
final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_chkGuestLoginActionPerformed
- if (chkGuestLogin.isSelected()) {
- chkProxyLogin.setSelected(false);
- hideProxyLoginFields();
- hideForGuestLogin();
-
- } else {
- showWhenGuestLogin();
- }
+// if (chkGuestLogin.isSelected()) {
+// chkProxyLogin.setSelected(false);
+// hideProxyLoginFields();
+// hideForGuestLogin();
+//
+// } else {
+// showWhenGuestLogin();
+// }
}// GEN-LAST:event_chkGuestLoginActionPerformed
private void btnOKActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnOKActionPerformed
@@ -1122,31 +1368,32 @@ public class LoginDialog extends JDialog {
private javax.swing.JButton btnP12CertificateLocation;
private javax.swing.JButton btnPEMCertificateLocation;
private javax.swing.JButton btnProxy;
- private javax.swing.JRadioButton btnProxyBrowser;
- private javax.swing.JRadioButton btnProxyCertKeyPair;
- private javax.swing.JRadioButton btnProxyFile;
- private javax.swing.JRadioButton btnProxyP12;
private javax.swing.ButtonGroup btngrpProxySource;
- private javax.swing.JPasswordField certpass;
+ private javax.swing.JPasswordField certpassP12;
+ private javax.swing.JPasswordField certpassPEM;
private javax.swing.JCheckBox chkAdvancedLogin;
private javax.swing.JCheckBox chkGuestLogin;
- private javax.swing.JCheckBox chkProxyLogin;
private javax.swing.JCheckBox chkRememberPass;
private javax.swing.JComboBox cmbBrowsers;
private javax.swing.JComboBox cmbCertificates;
private javax.swing.JComboBox comboLoginMode;
+ private javax.swing.JComboBox comboLoginType;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JLabel lblBrowserPass;
- private javax.swing.JLabel lblCertMode;
- private javax.swing.JLabel lblCertPass;
+ private javax.swing.JLabel lblCertPassP12;
+ private javax.swing.JLabel lblCertPassPEM;
private javax.swing.JLabel lblCerts;
private javax.swing.JLabel lblHost;
private javax.swing.JLabel lblKeyLocation;
+ private javax.swing.JLabel lblKeyfsLifetime;
+ private javax.swing.JLabel lblLdapKeyPass;
private javax.swing.JLabel lblLogin;
private javax.swing.JLabel lblLoginMode;
+ private javax.swing.JLabel lblLoginType;
private javax.swing.JLabel lblP12CertificateLocation;
private javax.swing.JLabel lblPEMCertificateLocation;
+ private javax.swing.JLabel lblPLGRIDUserName;
private javax.swing.JLabel lblPassword;
private javax.swing.JLabel lblPort;
private javax.swing.JLabel lblProxy;
@@ -1155,14 +1402,19 @@ public class LoginDialog extends JDialog {
private javax.swing.JLabel lblZone;
private javax.swing.JLabel lbllBrowserCombo;
private javax.swing.JLabel lbllCertCombo;
+ private javax.swing.JLabel lblplgridpass;
+ private javax.swing.JPasswordField ldapKeyPassword;
private javax.swing.JPasswordField password;
+ private javax.swing.JPasswordField plgridpass;
private javax.swing.JPanel pnlLoginInfo;
private javax.swing.JPanel pnlToolbar;
private javax.swing.JTextField txtCerts;
private javax.swing.JTextField txtHost;
private javax.swing.JTextField txtKeyLocation;
+ private javax.swing.JTextField txtKeyfsLifetime;
private javax.swing.JTextField txtP12CertificateLocation;
private javax.swing.JTextField txtPEMCertificateLocation;
+ private javax.swing.JTextField txtPLGRIDUserName;
private javax.swing.JTextField txtPort;
private javax.swing.JTextField txtProxy;
private javax.swing.JTextField txtResource;
@@ -1170,13 +1422,13 @@ public class LoginDialog extends JDialog {
private javax.swing.JTextField txtZone;
// End of variables declaration//GEN-END:variables
- private void hideNormalLoginFields(){
+ private void hideNormalLoginFields() {
password.setVisible(false);
lblPassword.setVisible(false);
txtUserName.setVisible(false);
lblUserName.setVisible(false);
}
-
+
private void showAdvancedViewFields() {
lblHost.setVisible(true);
txtHost.setVisible(true);
@@ -1190,6 +1442,9 @@ public class LoginDialog extends JDialog {
lblCerts.setVisible(true);
txtCerts.setVisible(true);
btnCerts.setVisible(true);
+
+ lblKeyfsLifetime.setVisible(true);
+ txtKeyfsLifetime.setVisible(true);
}
private void hideAdvancedViewFields() {
@@ -1205,6 +1460,9 @@ public class LoginDialog extends JDialog {
lblCerts.setVisible(false);
txtCerts.setVisible(false);
btnCerts.setVisible(false);
+
+ lblKeyfsLifetime.setVisible(false);
+ txtKeyfsLifetime.setVisible(false);
}
private void hideForGuestLogin() {
@@ -1221,32 +1479,6 @@ public class LoginDialog extends JDialog {
txtUserName.setVisible(true);
lblPassword.setVisible(true);
password.setVisible(true);
- lblLoginMode.setVisible(true);//symetric
- comboLoginMode.setVisible(true);
- }
-
- private void showProxyLoginFields() {
- //show buttngroup to let user choose a way to authenticate
- btnProxyBrowser.setVisible(true);
- btnProxyCertKeyPair.setVisible(true);
- btnProxyFile.setVisible(true);
- btnProxyP12.setVisible(true);
- lblCertMode.setVisible(true);
- }
-
- private void hideProxyLoginFields() {
- btnProxyBrowser.setVisible(false);
- btnProxyCertKeyPair.setVisible(false);
- btnProxyFile.setVisible(false);
- btnProxyP12.setVisible(false);
- lblCertMode.setVisible(false);
-
- hideCertKeyPairFields();
- hideCertP12Fields();
- hideCertInBrowserFields();
- hideProxyFileFields();
- // lblPassword.setVisible(true);
- // password.setVisible(true);
}
private void hideCertKeyPairFields() {
@@ -1256,8 +1488,8 @@ public class LoginDialog extends JDialog {
lblKeyLocation.setVisible(false);
txtKeyLocation.setVisible(false);
btnKeyLocation.setVisible(false);
- lblCertPass.setVisible(false);
- certpass.setVisible(false);
+ lblCertPassPEM.setVisible(false);
+ certpassPEM.setVisible(false);
}
private void showCertKeyPairFields() {
@@ -1267,24 +1499,24 @@ public class LoginDialog extends JDialog {
lblKeyLocation.setVisible(true);
txtKeyLocation.setVisible(true);
btnKeyLocation.setVisible(true);
- lblCertPass.setVisible(true);
- certpass.setVisible(true);
+ lblCertPassPEM.setVisible(true);
+ certpassPEM.setVisible(true);
}
private void hideCertP12Fields() {
lblP12CertificateLocation.setVisible(false);
txtP12CertificateLocation.setVisible(false);
btnP12CertificateLocation.setVisible(false);
- lblCertPass.setVisible(false);
- certpass.setVisible(false);
+ lblCertPassP12.setVisible(false);
+ certpassP12.setVisible(false);
}
private void showCertP12Fields() {
lblP12CertificateLocation.setVisible(true);
txtP12CertificateLocation.setVisible(true);
btnP12CertificateLocation.setVisible(true);
- lblCertPass.setVisible(true);
- certpass.setVisible(true);
+ lblCertPassP12.setVisible(true);
+ certpassP12.setVisible(true);
}
private void hideCertInBrowserFields() {
@@ -1322,53 +1554,73 @@ public class LoginDialog extends JDialog {
txtProxy.setVisible(true);
btnProxy.setVisible(true);
}
+
+ private void hideKeyFSFields() {
+ ldapKeyPassword.setVisible(false);
+ lblLdapKeyPass.setVisible(false);
+ lblPLGRIDUserName.setVisible(false);
+ txtPLGRIDUserName.setVisible(false);
+ lblplgridpass.setVisible(false);
+ plgridpass.setVisible(false);
+ }
+
+ private void showKeyFSFields() {
+ ldapKeyPassword.setVisible(true);
+ lblLdapKeyPass.setVisible(true);
+ lblPLGRIDUserName.setVisible(true);
+ txtPLGRIDUserName.setVisible(true);
+ lblplgridpass.setVisible(true);
+ plgridpass.setVisible(true);
+ }
/*
* Set selected the proper radiobutton depending the number of mode
* used while reading from properties
*/
private void setSelectedModeFields(int num) {
- switch (num) {
+ comboLoginType.setSelectedIndex(num);
+ }
+
+ private int getSelectedModeFieldNum() {
+ return comboLoginType.getSelectedIndex();
+ }
+
+ private void hideAllFields() {
+ hideForGuestLogin();
+ hideCertKeyPairFields();
+ hideCertP12Fields();
+ hideCertInBrowserFields();
+ hideProxyFileFields();
+ hideKeyFSFields();
+ }
+
+ private void showChoosenModeFields() {
+ switch (comboLoginType.getSelectedIndex()) {
+ case NO_CERTIFICATE_MODE:
+ hideAllFields();
+ showWhenGuestLogin();
+ break;
case PEM_MODE:
- btnProxyCertKeyPair.setSelected(true);
+ hideAllFields();
+ showCertKeyPairFields();
break;
case P12_MODE:
- btnProxyP12.setSelected(true);
+ hideAllFields();
+ showCertP12Fields();
break;
case BROWSER_MODE:
- btnProxyBrowser.setSelected(true);
+ hideAllFields();
+ showCertInBrowserFields();
+ fillBrowserComboBox();
break;
case PROXY_MODE:
- btnProxyFile.setSelected(true);
+ hideAllFields();
+ showProxyFileFields();
+ break;
+ case KEYFS_MODE:
+ hideAllFields();
+ showKeyFSFields();
break;
- }
- }
-
- private int getSelectedModeFieldNum() {
- if (btnProxyCertKeyPair.isSelected()) {
- return PEM_MODE;
- }
- if (btnProxyP12.isSelected()) {
- return P12_MODE;
- }
- if (btnProxyBrowser.isSelected()) {
- return BROWSER_MODE;
- }
- if (btnProxyFile.isSelected()) {
- return PROXY_MODE;
- }
- return -1; //old option used as default
- }
-
- private void showProxyChoosenModeFields() {
- if (btnProxyCertKeyPair.isSelected()) {
- showCertKeyPairFields();
- } else if (btnProxyP12.isSelected()) {
- showCertP12Fields();
- } else if (btnProxyBrowser.isSelected()) {
- showCertInBrowserFields();
- } else if (btnProxyFile.isSelected()) {
- showProxyFileFields();
}
}
/*
@@ -1379,36 +1631,180 @@ public class LoginDialog extends JDialog {
private GSSCredential getGssCredential() throws GlobusCredentialException, GSSException {
// should it be possinble to change by user?
int proxyLifetimeSeconds = 1000;
- if (btnProxyFile.isSelected()) {
- //a it was previously
- String proxyFilePath = txtProxy.getText();
- GlobusCredential globusCred = new GlobusCredential(proxyFilePath);
- return new GlobusGSSCredentialImpl(globusCred, GSSCredential.INITIATE_AND_ACCEPT);
- } else if (btnProxyCertKeyPair.isSelected()) {
- String pemCert = txtPEMCertificateLocation.getText();
- String pemKey = txtKeyLocation.getText();
- return GssUtil.createCredentialFromCertKeyPassTime(pemCert, pemKey, certpass.getText(), proxyLifetimeSeconds, GSIConstants.GSI_3_IMPERSONATION_PROXY);
- } else if (btnProxyP12.isSelected()) {
- String p12Cert = txtP12CertificateLocation.getText();
- //convert p12 to pem pair
- String certPath = System.getProperty("user.home") + File.separator + ".idrop" + File.separator + "usercert.pem";
- String keyPath = System.getProperty("user.home") + File.separator + ".idrop" + File.separator + "userkey.pem";
- try {
- CertificateConverter.PKCS12ToPem(p12Cert, certpass.getText());
- } catch (Exception ex) {
- log.error("Error during certificate conversion." + ex.getMessage());
- }
- return GssUtil.createCredentialFromCertKeyPassTime(certPath, keyPath, certpass.getText(), proxyLifetimeSeconds, GSIConstants.GSI_3_IMPERSONATION_PROXY);
- } else if (btnProxyBrowser.isSelected()) {
- String dn = (String) cmbCertificates.getSelectedItem();
- X509Certificate browserCert = getSelectedCertificateFromBrowser(dn);
- PrivateKey browserKey = getSelectedKeyFromBrowser(dn);
- String emptyPass = "";
- GssUtil.createCredentialFromCertKeyPassTime(browserCert, browserKey, emptyPass, proxyLifetimeSeconds, GSIConstants.GSI_3_IMPERSONATION_PROXY);
+
+ switch (comboLoginType.getSelectedIndex()) {
+ case NO_CERTIFICATE_MODE:
+
+ break;
+ case PEM_MODE:
+ String pemCert = txtPEMCertificateLocation.getText();
+ String pemKey = txtKeyLocation.getText();
+ return GssUtil.createCredentialFromCertKeyPassTime(pemCert, pemKey,
+ new String(certpassPEM.getPassword()), proxyLifetimeSeconds, GSIConstants.GSI_3_IMPERSONATION_PROXY);
+ case P12_MODE:
+ String p12Cert = txtP12CertificateLocation.getText();
+ //convert p12 to pem pair
+ String certPath = IDROP_HOME + File.separator + "usercert.pem";
+ String keyPath = IDROP_HOME + File.separator + "userkey.pem";
+ try {
+ CertificateConverter.PKCS12ToPem(p12Cert, certpassP12.getText());
+ } catch (Exception ex) {
+ log.error("Error during certificate conversion." + ex.getMessage());
+ }
+ return GssUtil.createCredentialFromCertKeyPassTime(certPath, keyPath,
+ new String(certpassP12.getPassword()), proxyLifetimeSeconds, GSIConstants.GSI_3_IMPERSONATION_PROXY);
+
+ case BROWSER_MODE:
+ String dn = (String) cmbCertificates.getSelectedItem();
+ X509Certificate browserCert = getSelectedCertificateFromBrowser(dn);
+ PrivateKey browserKey = getSelectedKeyFromBrowser(dn);
+ String emptyPass = "";
+ GssUtil.createCredentialFromCertKeyPassTime(browserCert,
+ browserKey, emptyPass, proxyLifetimeSeconds, GSIConstants.GSI_3_IMPERSONATION_PROXY);
+
+ case PROXY_MODE:
+ String proxyFileP = txtProxy.getText();
+ GlobusCredential globusC = new GlobusCredential(proxyFileP);
+ return new GlobusGSSCredentialImpl(globusC, GSSCredential.INITIATE_AND_ACCEPT);
+ case KEYFS_MODE:
+ try {
+ int hours = 10;
+ try {
+ hours = Integer.parseInt(txtKeyfsLifetime.getText());
+ } catch (Exception ex) {
+ }
+ String proxyFilePath = importCredentialsFromKeyFS(txtPLGRIDUserName.getText(), plgridpass.getText(), ldapKeyPassword.getText(), hours);
+ if (proxyFilePath == null) {
+ return null;
+ }
+ GlobusCredential globusCred = new GlobusCredential(proxyFilePath);
+ return new GlobusGSSCredentialImpl(globusCred, GSSCredential.INITIATE_AND_ACCEPT);
+ } catch (IOException ex) {
+ log.error("Importing and using proxy from keyFS failed", ex);
+ }
}
+
return null;
}
/*
+ * KeyFS
+ */
+
+ private String importCredentialsFromKeyFS(String username, String password, String keyPasword, int hours) throws IOException {
+ log.info("Importing proxy from keyFS");
+
+ String result = null;
+ String host = "ui.plgrid.wcss.wroc.pl";
+ String remotePathPrefix = "/mnt/keyfs/users/";
+ String remotePathPostfix = "/.globus/";
+ String remoteUserHome = "/home/grid/users/" + username + "/";
+ String certName = remotePathPrefix + username + remotePathPostfix + "usercert.pem";
+ String keyName = remotePathPrefix + username + remotePathPostfix + "userkey.pem";
+ String proxyFileName = "proxy";
+ String outName = remoteUserHome + proxyFileName;
+ String userHomeDir = IDROP_HOME;
+
+ JSch jsch = new JSch();
+ String keypass = keyPasword;
+ if (keypass == null || "".equals(keypass)) {
+ keypass = password;
+ }
+ String command = "echo " + keypass + " | grid-proxy-init -valid " + hours + ":0 -cert " + certName + " -key " + keyName + " -out " + outName + " -pwstdin";
+ String commandRemove = "rm " + outName;
+
+ try {
+ java.util.Properties config = new java.util.Properties();
+ config.put("StrictHostKeyChecking", "no");
+ com.jcraft.jsch.Session session = jsch.getSession(username, host);
+ session.setPassword(password);
+ session.setConfig(config);
+ session.connect();
+
+ Channel channel = session.openChannel("exec");
+ ((ChannelExec) channel).setCommand(command);
+ channel.connect();
+
+ byte[] tmp = new byte[1024];
+ InputStream in = channel.getInputStream();
+ channel.connect();
+
+ int count = 0;
+ while (true) {
+ count++;
+ if (count > 60) {
+ break;
+ }
+ while (in.available() > 0) {
+ int i = in.read(tmp, 0, 1024);
+ if (i < 0) {
+ break;
+ }
+ // System.out.print(new String(tmp, 0, i));
+ }
+ if (channel.isClosed()) {
+ log.info("exit-status: " + channel.getExitStatus());
+ break;
+ }
+ try {
+ Thread.sleep(1000);
+ } catch (Exception ee) {
+ }
+ }
+ if (channel.getExitStatus() != 0) {
+ return null;
+ }
+ channel.disconnect();
+
+ Channel channel2 = session.openChannel("sftp");
+ channel2.connect();
+ ChannelSftp c = (ChannelSftp) channel2;
+ c.get(outName, userHomeDir);
+ result = IDROP_HOME + "/" + proxyFileName;
+ channel2.disconnect();
+ log.info("Removing proxy from remote.");
+ Channel channel3 = session.openChannel("exec");
+ ((ChannelExec) channel3).setCommand(commandRemove);
+ channel3.connect();
+
+ in = channel3.getInputStream();
+ channel3.connect();
+
+ while (true) {
+ count++;
+ if (count > 60) {
+ break;
+ }
+ while (in.available() > 0) {
+ int i = in.read(tmp, 0, 1024);
+ if (i < 0) {
+ break;
+ }
+ }
+ if (channel3.isClosed()) {
+ log.info("exit-status: " + channel.getExitStatus());
+ break;
+ }
+ try {
+ Thread.sleep(1000);
+ } catch (Exception ee) {
+ }
+ }
+ if (channel3.getExitStatus() != 0) {
+ log.error("Proxy removal failed.");
+ }
+ channel3.disconnect();
+
+ session.disconnect();
+
+ } catch (SftpException ex) {
+ log.error("SFTP failed", ex);
+ } catch (JSchException ex) {
+ log.error("JSch session start failed", ex);
+ }
+ return result;
+ }
+
+ /*
* WARNING:
* - partly untested code below
* - code based on correct function actionPerformed from CertificateManager.java in Certman project
@@ -1418,7 +1814,6 @@ public class LoginDialog extends JDialog {
*
* It is necessary due to he fact, that this jar is unreachable in main maven repo
*/
-
private void fillBrowserComboBox() {
cmbBrowsers.removeAllItems();
String[] browsers = getBrowsersList();
@@ -1584,4 +1979,4 @@ public class LoginDialog extends JDialog {
log.debug("Browser cert key present : " + (browserKey != null));
return browserKey;
}
-}
+} \ No newline at end of file
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 a9e49f9..f0c0e02 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
@@ -40,12 +40,15 @@ public interface IdropConfigurationService {
// for GSI
public static final String ACCOUNT_CACHE_PROXY_LOCATION = "irods.account.gsi.proxy.location";
public static final String ACCOUNT_CACHE_CERTIFICATES_LOCATION = "irods.account.gsi.certificates.location";
- public static final String ACCOUNT_CACHE_USER_AUTO_GSI = "irods.account.autogsi";
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";
+ public static final String ACCOUNT_CACHE_CERT_P12_PASSWORD = "irods.account.gsi.cert.p12.password";
+ public static final String ACCOUNT_CACHE_CERT_PEM_PASSWORD = "irods.account.gsi.cert.pem.password";
+ public static final String ACCOUNT_CACHE_LOGIN_TYPE = "irods.account.gsi.login.type";
+ public static final String ACCOUNT_CACHE_PLGRID_USERNAME = "irods.account.gsi.plgrid.username";
+ public static final String ACCOUNT_CACHE_PLGRID_PASSWORD = "irods.account.gsi.plgrid.password";
+ public static final String ACCOUNT_CACHE_PLGRID_KEY_PASSWORD = "irods.account.gsi.plgrid.key.password";
// /for GSI
public static final String POLICY_AWARE_PROPERTY = "policy.aware";
public static final String LOOK_AND_FEEL = "idrop.lookandfeel";
@@ -71,7 +74,7 @@ public interface IdropConfigurationService {
public static final String IRODS_CONNECTION_RESTART = "transfer.reconnect";
public static final String IDROP_ENABLE_RESC_EDIT = "idrop.settings.enable_default_resc_edit";
public static final String IDROP_PUBLIC_LINK_SERVICE = "idrop.public.link.service.url";
-
+
Properties bootstrapConfigurationAndMergePropertiesFromLocalAndClasspath()
throws IdropException;
@@ -142,4 +145,4 @@ public interface IdropConfigurationService {
final JargonProperties jargonProperties) throws JargonException;
-}
+} \ No newline at end of file
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java
index bc3281c..af57e3c 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java
@@ -1,5 +1,5 @@
package org.irods.jargon.idrop.desktop.systraygui.utils;
public final class Version {
public static String VERSION="2.0.1-SNAPSHOT";
- public static String BUILD_TIME="20130829-1603";
+ public static String BUILD_TIME="20131007-1222";
}