Examples of PasswordAuthentication


Examples of java.net.PasswordAuthentication

  public boolean setProxyAuthentication() {
    if (m_httpProxy != null && m_proxyUsername != null &&
        m_proxyPassword != null) {
      Authenticator.setDefault(new Authenticator() {
        protected PasswordAuthentication getPasswordAuthentication() {
          return new
             PasswordAuthentication(m_proxyUsername,m_proxyPassword.toCharArray());
      }});
      return true;
    }
   
View Full Code Here

Examples of java.net.PasswordAuthentication

        /**
         * Sets a new user and password.
         */
        public synchronized void setPasswordAuthentication(String user, String password) {
            passwordAuthentication = new PasswordAuthentication(user, password.toCharArray());
        }
View Full Code Here

Examples of java.net.PasswordAuthentication

     */
    public PasswordAuthentication getPasswordAuthentication() {
        String player = "guest-" + random.nextInt(1000);
        setStatus("Logging in as " + player);
        String password = "guest";
        return new PasswordAuthentication(player, password.toCharArray());
    }
View Full Code Here

Examples of java.net.PasswordAuthentication

       
        protected abstract String getProtocolName();
        protected abstract ProtocolVersion getProtocolVersion();
       
        public PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication(username, password.toCharArray());
        }
View Full Code Here

Examples of java.net.PasswordAuthentication

         */
        public PasswordAuthentication getPasswordAuthentication() {
            // This is called to get the user name and authentication data (eg password)
            // to be authenticated server side.
            LoginParameters loginParams = getCurrentLogin().getLoginParameters();
            return new PasswordAuthentication(loginParams.getUserName(),
                                              loginParams.getPassword());
        }
View Full Code Here

Examples of java.net.PasswordAuthentication

                lock.wait();
            } catch(InterruptedException ie) { }
            if (!result)
                return null;

            return new PasswordAuthentication(userID, password);
        }
    }
View Full Code Here

Examples of java.net.PasswordAuthentication

    // API ******************************************************************

    // Overriding Authenticator *********************************************

    protected PasswordAuthentication getPasswordAuthentication() {
        PasswordAuthentication result = null;

        if (isProxyAuthentication()) {
            String proxyUser = System.getProperty("http.proxyUser");
            if ((proxyUser != null) && (proxyUser.trim().length() > 0)) {
                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

Examples of javax.mail.PasswordAuthentication

          if(smtp_port>0 && smtp_port!=25)
              mailProperties.put("mail.smtp.port", String.valueOf(smtp_port));
          mailProperties.put("mail.smtp.auth", "true"); //����smtp��֤���ܹؼ���һ��
          mailSession = Session.getDefaultInstance(mailProperties, new Authenticator(){
        protected PasswordAuthentication getPasswordAuthentication() {
              return new PasswordAuthentication(smtp_user, smtp_pass);
        }});
    }
    else{
          Properties props = new Properties();
          //Not needed for production environment
View Full Code Here

Examples of javax.mail.PasswordAuthentication

    /**
     * ����ʵ���ʼ������û���֤
     * @see javax.mail.Authenticator#getPasswordAuthentication
     */
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(username, userpasswd);
    }
View Full Code Here

Examples of javax.mail.PasswordAuthentication

{
  private PasswordAuthentication auth = null;
 
  public UsernamePasswordAuthenticator(String user, String password)
  {
    auth = new PasswordAuthentication(user, password);
  }
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.