Package org.apache.ivy.util

Examples of org.apache.ivy.util.Credentials


                String proxyPass = System.getProperty("http.proxyPassword", "");
                Message.debug("authenicating to proxy server with username [" + proxyUser + "]");
                result = new PasswordAuthentication(proxyUser, proxyPass.toCharArray());
            }
        } else {
            Credentials c = CredentialsStore.INSTANCE.getCredentials(getRequestingPrompt(),
                getRequestingHost());
            Message.debug("authentication: k='"
                    + Credentials.buildKey(getRequestingPrompt(), getRequestingHost()) + "' c='" + c
                    + "'");
            if (c != null) {
                result = new PasswordAuthentication(c.getUserName(), c.getPasswd().toCharArray());
            }
        }
       
        if ((result == null) && (original != null)) {
            Authenticator.setDefault(original);
View Full Code Here


            return true;
        }

        public String getPassword() {
            if (userPassword == null) {
                Credentials c = CredentialsUtil.promptCredentials(new Credentials(null, host,
                        userName, userPassword), passfile);
                if (c != null) {
                    userName = c.getUserName();
                    userPassword = c.getPasswd();
                }
            }
            return userPassword;
        }
View Full Code Here

            return userPassword;
        }

        public String getPassphrase() {
            if (pemPassword == null && pemFile != null) {
                Credentials c = CredentialsUtil.promptCredentials(new Credentials(null, pemFile
                        .getAbsolutePath(), userName, pemPassword), passfile);
                if (c != null) {
                    userName = c.getUserName();
                    pemPassword = c.getPasswd();
                }
            }
            return pemPassword;
        }
View Full Code Here

                String proxyPass = System.getProperty("http.proxyPassword", "");
                Message.debug("authenicating to proxy server with username [" + proxyUser + "]");
                result = new PasswordAuthentication(proxyUser, proxyPass.toCharArray());
            }
        } else {
            Credentials c = CredentialsStore.INSTANCE.getCredentials(getRequestingPrompt(),
                getRequestingHost());
            Message.debug("authentication: k='"
                    + Credentials.buildKey(getRequestingPrompt(), getRequestingHost()) + "' c='" + c
                    + "'");
            if (c != null) {
                final String password = c.getPasswd() == null ? "" : c.getPasswd();
                result = new PasswordAuthentication(c.getUserName(), password.toCharArray());
            }
        }
       
        if ((result == null) && (original != null)) {
            Authenticator.setDefault(original);
View Full Code Here

                String proxyPass = System.getProperty("http.proxyPassword", "");
                Message.debug("authenicating to proxy server with username [" + proxyUser + "]");
                result = new PasswordAuthentication(proxyUser, proxyPass.toCharArray());
            }
        } else {
            Credentials c = CredentialsStore.INSTANCE.getCredentials(getRequestingPrompt(),
                getRequestingHost());
            Message.debug("authentication: k='"
                    + Credentials.buildKey(getRequestingPrompt(), getRequestingHost()) + "' c='" + c
                    + "'");
            if (c != null) {
                result = new PasswordAuthentication(c.getUserName(), c.getPasswd().toCharArray());
            }
        }
       
        if ((result == null) && (original != null)) {
            Authenticator.setDefault(original);
View Full Code Here

            throw new IllegalArgumentException(
                "missing host information. host should be provided either "
                + "directly on the repository or in the connection URI");
        }
        if (user == null) {
             Credentials c = requestCredentials(host);
             if (c != null) {
                 user = c.getUserName();
                 userPassword = c.getPasswd();
             } else {
                 Message.error("username is not set");
             }
        }
        return SshCache.getInstance().getSession(host, port, user, userPassword, getKeyFile(),
View Full Code Here

     * @return credentials for given host
     **/
    private Credentials requestCredentials(String host) {
      Object o =  credentialsCache.get(host);
      if (o == null) {
         Credentials c = CredentialsUtil.promptCredentials(
             new Credentials(null, host, user, userPassword), getPassFile());
         if (c != null) {
            if (credentialsCache.size() > MAX_CREDENTILAS_CACHE_SIZE) {
              credentialsCache.clear();
            }
            credentialsCache.put(host, c);
View Full Code Here

            // user-agent
            httpClient.getParams().setParameter("http.useragent",
                "Apache Ivy/" + Ivy.getIvyVersion());
        }

        Credentials c = getCredentials(url);
        if (c != null) {
            Message.debug("found credentials for " + url + ": " + c);
            httpClient.getState().setProxyCredentials(
                new AuthScope(c.getHost(), AuthScope.ANY_PORT, c.getRealm()),
                new NTCredentials(c.getUserName(), c.getPasswd(),
                    HostUtil.getLocalHostName(), c.getRealm()));
        }

        return httpClient;
    }
View Full Code Here

TOP

Related Classes of org.apache.ivy.util.Credentials

Copyright © 2018 www.massapicom. 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.