Package java.net

Examples of java.net.PasswordAuthentication


         
          {     
            try{
              auth_mon.enter();
           
              PasswordAuthentication  res = 
                getAuthentication(
                    getRequestingPrompt(),
                    getRequestingProtocol(),
                    getRequestingHost(),
                    getRequestingPort());
View Full Code Here


      String  socks_user   = COConfigurationManager.getStringParameter( "Proxy.Username" ).trim();
      String  socks_pw  = COConfigurationManager.getStringParameter( "Proxy.Password" ).trim();

      if ( socks_user.equalsIgnoreCase( "<none>" )){
       
        return( new PasswordAuthentication( "", "".toCharArray()));
      }
     
        // actually getting all sorts of problems with Java not caching socks passwords
        // properly so I've abandoned prompting for them and always use the defined
        // password
     
      if ( socks_user.length() == 0 ){
       
        Logger.log(
          new LogAlert(false, LogAlert.AT_WARNING, "Socks server is requesting authentication, please setup user and password in config" ));
      }
     
      return( new PasswordAuthenticationsocks_user, socks_pw.toCharArray()));
    }
   
    try{     
      URL  tracker_url = new URL( protocol + "://" + host + ":" + port + "/" );
   
View Full Code Here

    Iterator  it = password_listeners.iterator();
   
    while( it.hasNext()){
     
      try{
        PasswordAuthentication res = ((SEPasswordListener)it.next()).getAuthentication( realm, tracker );
       
        if ( res != null ){
         
          return( res );
        }
View Full Code Here

       
        user_bit  = user_info.substring(0,pos);
        pw_bit    = user_info.substring(pos+1);
      }
     
      return( new PasswordAuthentication( user_bit, pw_bit.toCharArray()));
    }
   
    return( new PasswordAuthentication( user_name, password.toCharArray()));
  }
View Full Code Here

      this.password = password;
    }

    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
      return new PasswordAuthentication(username, password);
    }
View Full Code Here

                    String protocol = url.getProtocol();
                    int port = url.getPort();
                    if (port == -1) {
                        port = "https".equalsIgnoreCase(protocol) ? 443 : 80;
                    }
                    PasswordAuthentication auth =
                            Authenticator.requestPasswordAuthentication(null,
                                    port, protocol, "", method);
                    if (auth != null) {
                        user = auth.getUserName();
                        password = new String(auth.getPassword());
                    }
                } catch (Exception ex) { }
            }
            Type2Message type2 = (Type2Message) message;
            message = new Type3Message(type2, password, domain, user,
View Full Code Here

    private final PasswordAuthentication _password;

    public MyAuthenticator(String user, String password)
    {
      super();
      _password = new PasswordAuthentication(user, password.toCharArray());

    }
View Full Code Here

    /**
     * Does authentication with the uddi registry
     */
    protected void login()
    {
        PasswordAuthentication passwdAuth = new PasswordAuthentication(userid,
                passwd.toCharArray());
        Set creds = new HashSet();
        creds.add(passwdAuth);

        try
View Full Code Here

            con = factory.createConnection();
        } catch (JAXRException e)
        {
            e.printStackTrace();
        }
        PasswordAuthentication passwdAuth = new PasswordAuthentication("jbosscts",
                passwd.toCharArray());
        Set creds = new HashSet();
        creds.add(passwdAuth);

        try
View Full Code Here

    URL requestURL = getRequestingURL();
    try {
      String uri = requestURL.toURI().normalize().toString();
      Site site = findBestMatch(uri);
      if (site != null) {
        return new PasswordAuthentication(site.login, site.pwd);
      }
    } catch (URISyntaxException e) {
      e.printStackTrace();
      return null;
    }
View Full Code Here

TOP

Related Classes of java.net.PasswordAuthentication

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.