Examples of SavedAuthentication


Examples of org.apache.geronimo.deployment.cli.DeployUtils.SavedAuthentication

        }

        if (user == null && password == null) {
            String uri = DeployUtils.getConnectionURI(host, portI, secure);
            try {
                SavedAuthentication savedAuthentication = DeployUtils.readSavedCredentials(uri);
                if (savedAuthentication != null) {
                    user = savedAuthentication.getUser();
                    password = new String(savedAuthentication.getPassword());
                }
            } catch (IOException e) {
                System.out.println("Warning: " + e.getMessage());
            }
        }
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.DeployUtils.SavedAuthentication

        }

        if (user == null && password == null) {
            String uri = DeployUtils.getConnectionURI(host, portI, secure);
            try {
                SavedAuthentication savedAuthentication = DeployUtils.readSavedCredentials(uri);
                if (savedAuthentication != null) {
                    user = savedAuthentication.getUser();
                    password = new String(savedAuthentication.getPassword());
                }
            } catch (IOException e) {
                System.out.println("Warning: " + e.getMessage());
            }
        }
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.DeployUtils.SavedAuthentication

        }
        String useURI = argURI == null ? DeployUtils.getConnectionURI(null, null, secure) : argURI;

        if (user == null && password == null) {
            try {
                SavedAuthentication savedAuthentication = DeployUtils.readSavedCredentials(useURI);
                if (savedAuthentication != null) {
                    user = savedAuthentication.getUser();
                    password = new String(savedAuthentication.getPassword());
                }
            } catch (IOException e) {
                System.out.println("Warning: " + e.getMessage());
            }
        }

        if (secure) {
            try {
                Properties props = new Properties();

                String keyStorePassword = null;
                String trustStorePassword = null;

                FileInputStream fstream = new FileInputStream(System.getProperty(KEYSTORE_TRUSTSTORE_PASSWORD_FILE,
                        DEFAULT_KEYSTORE_TRUSTSTORE_PASSWORD_FILE));
                props.load(fstream);

                keyStorePassword = (String) EncryptionManager.decrypt(props.getProperty("keyStorePassword"));
                trustStorePassword = (String) EncryptionManager.decrypt(props.getProperty("trustStorePassword"));

                fstream.close();

                String value = System.getProperty("javax.net.ssl.keyStore", System.getProperty(GERONIMO_HOME)
                        + DEFAULT_TRUSTSTORE_KEYSTORE_LOCATION);
                String value1 = System.getProperty("javax.net.ssl.trustStore", System.getProperty(GERONIMO_HOME)
                        + DEFAULT_TRUSTSTORE_KEYSTORE_LOCATION);
                System.setProperty("javax.net.ssl.keyStore", value);
                System.setProperty("javax.net.ssl.trustStore", value1);
                System.setProperty("javax.net.ssl.keyStorePassword", keyStorePassword);
                System.setProperty("javax.net.ssl.trustStorePassword", trustStorePassword);
            } catch (IOException e) {
                throw new DeploymentException("Unable to set KeyStorePassword and TrustStorePassword.", e);
            }
        }
        if (user == null || password == null) {
            try {
                if (user == null) {
                    user = handler.getUsername();
                }
                if (password == null) {
                    password = handler.getPassword();
                }
            } catch (IOException e) {
                throw new DeploymentException("Unable to prompt for login", e);
            }
        }
        try {
            manager = mgr.getDeploymentManager(useURI, user, password);
            auth = new SavedAuthentication(useURI, user, password == null ? null : password.toCharArray());
        } catch (AuthenticationFailedException e) {
            // server's there, you just can't talk to it
            throw new DeploymentException("Login Failed");
        } catch (DeploymentManagerCreationException e) {
            throw new DeploymentException("Unable to connect to server at " + useURI + " -- " + e.getMessage(), e);
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.DeployUtils.SavedAuthentication

        }
        String useURI = argURI == null ? DeployUtils.getConnectionURI(null, null, secure) : argURI;

        if (user == null && password == null) {
            try {
                SavedAuthentication savedAuthentication = DeployUtils.readSavedCredentials(useURI);
                if (savedAuthentication != null) {
                    user = savedAuthentication.getUser();
                    password = new String(savedAuthentication.getPassword());
                }
            } catch (IOException e) {
                System.out.println("Warning: " + e.getMessage());
            }
        }

        if (secure) {
            try {
                Properties props = new Properties();

                String keyStorePassword = null;
                String trustStorePassword = null;

                FileInputStream fstream = new FileInputStream(System.getProperty(KEYSTORE_TRUSTSTORE_PASSWORD_FILE,
                        DEFAULT_KEYSTORE_TRUSTSTORE_PASSWORD_FILE));
                props.load(fstream);

                keyStorePassword = (String) EncryptionManager.decrypt(props.getProperty("keyStorePassword"));
                trustStorePassword = (String) EncryptionManager.decrypt(props.getProperty("trustStorePassword"));

                fstream.close();

                String value = System.getProperty("javax.net.ssl.keyStore", System.getProperty(GERONIMO_HOME)
                        + DEFAULT_TRUSTSTORE_KEYSTORE_LOCATION);
                String value1 = System.getProperty("javax.net.ssl.trustStore", System.getProperty(GERONIMO_HOME)
                        + DEFAULT_TRUSTSTORE_KEYSTORE_LOCATION);
                System.setProperty("javax.net.ssl.keyStore", value);
                System.setProperty("javax.net.ssl.trustStore", value1);
                System.setProperty("javax.net.ssl.keyStorePassword", keyStorePassword);
                System.setProperty("javax.net.ssl.trustStorePassword", trustStorePassword);
            } catch (IOException e) {
                throw new DeploymentException("Unable to set KeyStorePassword and TrustStorePassword.", e);
            }
        }
        if (user == null || password == null) {
            try {
                if (user == null) {
                    user = handler.getUsername();
                }
                if (password == null) {
                    password = handler.getPassword();
                }
            } catch (IOException e) {
                throw new DeploymentException("Unable to prompt for login", e);
            }
        }
        try {
            manager = mgr.getDeploymentManager(useURI, user, password);
            auth = new SavedAuthentication(useURI, user, password == null ? null : password.toCharArray());
        } catch (AuthenticationFailedException e) {
            // server's there, you just can't talk to it
            throw new DeploymentException("Login Failed");
        } catch (DeploymentManagerCreationException e) {
            throw new DeploymentException("Unable to connect to server at " + useURI + " -- " + e.getMessage(), e);
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.DeployUtils.SavedAuthentication

        }

        if (user == null && password == null) {
            String uri = DeployUtils.getConnectionURI(host, portI, secure);
            try {
                SavedAuthentication savedAuthentication = DeployUtils.readSavedCredentials(uri);
                if (savedAuthentication != null) {
                    user = savedAuthentication.getUser();
                    password = new String(savedAuthentication.getPassword());
                }
            } catch (IOException e) {
                System.out.println("Warning: " + e.getMessage());
            }
        }
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.DeployUtils.SavedAuthentication

        if (user == null && password == null) {
            String uri = DeployUtils.getConnectionURI(host, port, secure);
            ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
            Thread.currentThread().setContextClassLoader(DeployUtils.class.getClassLoader());
            try {               
                SavedAuthentication savedAuthentication = DeployUtils.readSavedCredentials(uri);
                if (savedAuthentication != null) {
                    user = savedAuthentication.getUser();
                    password = new String(savedAuthentication.getPassword());
                }
            } catch (IOException e) {
                System.out.println("Warning: " + e.getMessage());
            } finally {
                Thread.currentThread().setContextClassLoader(oldCL);
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.DeployUtils.SavedAuthentication

            uri = DeployUtils.getConnectionURI(host, port, secure);
        }
       
        if (user == null && password == null) {
            try {
                SavedAuthentication savedAuthentication = DeployUtils.readSavedCredentials(uri);
                if (savedAuthentication != null) {
                    user = savedAuthentication.getUser();
                    password = new String(savedAuthentication.getPassword());
                }
            } catch (IOException e) {
                System.out.println("Warning: " + e.getMessage());
            }
        }
        if (secure) {
            DeployUtils.setSecurityProperties();
        }
        if (user == null || password == null) {
            try {
                if (user == null) {
                    user = handler.getUsername();
                }
                if (password == null) {
                    password = handler.getPassword();
                }
            } catch (IOException e) {
                throw new DeploymentException("Unable to prompt for login", e);
            }
        }
        try {
            manager = mgr.getDeploymentManager(uri, user, password);
            auth = new SavedAuthentication(uri, user, password == null ? null : password.toCharArray());
        } catch (AuthenticationFailedException e) {
            // server's there, you just can't talk to it
            throw new DeploymentException("Login Failed");
        } catch (DeploymentManagerCreationException e) {
            throw new DeploymentException("Unable to connect to server at " + uri + " -- " + e.getMessage(), e);
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.DeployUtils.SavedAuthentication

        if (user == null && password == null) {
            String uri = DeployUtils.getConnectionURI(host, port, secure);
            ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
            Thread.currentThread().setContextClassLoader(DeployUtils.class.getClassLoader());
            try {               
                SavedAuthentication savedAuthentication = DeployUtils.readSavedCredentials(uri);
                if (savedAuthentication != null) {
                    user = savedAuthentication.getUser();
                    password = new String(savedAuthentication.getPassword());
                }
            } catch (IOException e) {
                System.out.println("Warning: " + e.getMessage());
            } finally {
                Thread.currentThread().setContextClassLoader(oldCL);
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.DeployUtils.SavedAuthentication

            mgr.registerDeploymentFactory(geronimoDeploymentFactory);
        }
        String useURI = argURI == null ? DeployUtils.getConnectionURI(null, null, secure) : argURI;
        if (user == null && password == null) {
            try {
                SavedAuthentication savedAuthentication = DeployUtils.readSavedCredentials(useURI);
                if (savedAuthentication != null) {
                    user = savedAuthentication.getUser();
                    password = new String(savedAuthentication.getPassword());
                }
            } catch (IOException e) {
                System.out.println("Warning: " + e.getMessage());
            }
        }
        if (secure) {
            DeployUtils.setSecurityProperties();
        }
        if (user == null || password == null) {
            try {
                if (user == null) {
                    user = handler.getUsername();
                }
                if (password == null) {
                    password = handler.getPassword();
                }
            } catch (IOException e) {
                throw new DeploymentException("Unable to prompt for login", e);
            }
        }
        try {
            manager = mgr.getDeploymentManager(useURI, user, password);
            auth = new SavedAuthentication(useURI, user, password == null ? null : password.toCharArray());
        } catch (AuthenticationFailedException e) {
            // server's there, you just can't talk to it
            throw new DeploymentException("Login Failed");
        } catch (DeploymentManagerCreationException e) {
            throw new DeploymentException("Unable to connect to server at " + useURI + " -- " + e.getMessage(), e);
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.DeployUtils.SavedAuthentication

        }
        String useURI = argURI == null ? DeployUtils.getConnectionURI(null, null, secure) : argURI;

        if (user == null && password == null) {
            try {
                SavedAuthentication savedAuthentication = DeployUtils.readSavedCredentials(useURI);
                if (savedAuthentication != null) {
                    user = savedAuthentication.getUser();
                    password = new String(savedAuthentication.getPassword());
               
            } catch (IOException e) {
                System.out.println("Warning: " + e.getMessage());
            }         
        }

        if (user == null || password == null) {
            try {
                if (user == null) {
                    user = handler.getUsername();
                }
                if (password == null) {
                    password = handler.getPassword();
                }
            } catch (IOException e) {
                throw new DeploymentException("Unable to prompt for login", e);
            }
        }
        try {
            manager = mgr.getDeploymentManager(useURI, user, password);
            auth = new SavedAuthentication(useURI, user, password == null ? null : password.toCharArray());
        } catch (AuthenticationFailedException e) {
            // server's there, you just can't talk to it
            throw new DeploymentException("Login Failed");
        } catch (DeploymentManagerCreationException e) {
            throw new DeploymentException("Unable to connect to server at " + useURI + " -- " + e.getMessage(), e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.