1 package es.whatabout.common.security; 2 3 import java.net.Authenticator; 4 import java.net.PasswordAuthentication; 5 6 /** 7 * 8 * @author whatabout.es 9 * 10 */ 11 public class ProxyAuthenticator extends Authenticator { 12 13 private String username, password; 14 15 public ProxyAuthenticator(String username, String password) { 16 17 this.username = username; 18 this.password = password; 19 } 20 21 protected PasswordAuthentication getPasswordAuthentication() { 22 23 return new PasswordAuthentication(username, password.toCharArray()); 24 } 25 } 26