Java Code Examples for java.net.Authenticator.RequestorType#PROXY

The following examples show how to use java.net.Authenticator.RequestorType#PROXY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultAuthenticator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected PasswordAuthentication getPasswordAuthentication() {
    //If user sets proxy user and passwd and the RequestType is from proxy server then create
    // PasswordAuthentication using proxyUser and proxyPasswd;
    if ((getRequestorType() == RequestorType.PROXY) && proxyUser != null && proxyPasswd != null) {
        return new PasswordAuthentication(proxyUser, proxyPasswd.toCharArray());
    }
    for (AuthInfo auth : authInfo) {
        if (auth.matchingHost(getRequestingURL())) {
            return new PasswordAuthentication(auth.getUser(), auth.getPassword().toCharArray());
        }
    }
    return null;
}
 
Example 2
Source File: NegotiateAuthentication.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
* Constructor used for both WWW and proxy entries.
* @param hci a schemed object.
*/
public NegotiateAuthentication(HttpCallerInfo hci) {
    super(RequestorType.PROXY==hci.authType ? PROXY_AUTHENTICATION : SERVER_AUTHENTICATION,
          hci.scheme.equalsIgnoreCase("Negotiate") ? NEGOTIATE : KERBEROS,
          hci.url,
          "");
    this.hci = hci;
}
 
Example 3
Source File: HttpCallerInfo.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor an un-schemed object for proxy access.
 */
public HttpCallerInfo(URL url, String host, int port) {
    this.url= url;
    this.host = host;
    this.port = port;
    prompt = "";
    addr = null;
    protocol = url.getProtocol();
    authType = RequestorType.PROXY;
    scheme = "";
}
 
Example 4
Source File: HttpCallerInfo.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor an un-schemed object for proxy access.
 */
public HttpCallerInfo(URL url, String host, int port, Authenticator a) {
    this.url= url;
    this.host = host;
    this.port = port;
    prompt = "";
    addr = null;
    protocol = url.getProtocol();
    authType = RequestorType.PROXY;
    scheme = "";
    authenticator = a;
}
 
Example 5
Source File: NegotiateAuthentication.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
* Constructor used for both WWW and proxy entries.
* @param hci a schemed object.
*/
public NegotiateAuthentication(HttpCallerInfo hci) {
    super(RequestorType.PROXY==hci.authType ? PROXY_AUTHENTICATION : SERVER_AUTHENTICATION,
          hci.scheme.equalsIgnoreCase("Negotiate") ? NEGOTIATE : KERBEROS,
          hci.url,
          "",
          AuthenticatorKeys.getKey(hci.authenticator));
    this.hci = hci;
}
 
Example 6
Source File: HttpCallerInfo.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor an un-schemed object for proxy access.
 */
public HttpCallerInfo(URL url, String host, int port, Authenticator a) {
    this.url= url;
    this.host = host;
    this.port = port;
    prompt = "";
    addr = null;
    protocol = url.getProtocol();
    authType = RequestorType.PROXY;
    scheme = "";
    authenticator = a;
}
 
Example 7
Source File: NegotiateAuthentication.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
* Constructor used for both WWW and proxy entries.
* @param hci a schemed object.
*/
public NegotiateAuthentication(HttpCallerInfo hci) {
    super(RequestorType.PROXY==hci.authType ? PROXY_AUTHENTICATION : SERVER_AUTHENTICATION,
          hci.scheme.equalsIgnoreCase("Negotiate") ? NEGOTIATE : KERBEROS,
          hci.url,
          "",
          AuthenticatorKeys.getKey(hci.authenticator));
    this.hci = hci;
}
 
Example 8
Source File: DefaultAuthenticator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected PasswordAuthentication getPasswordAuthentication() {
    //If user sets proxy user and passwd and the RequestType is from proxy server then create
    // PasswordAuthentication using proxyUser and proxyPasswd;
    if ((getRequestorType() == RequestorType.PROXY) && proxyUser != null && proxyPasswd != null) {
        return new PasswordAuthentication(proxyUser, proxyPasswd.toCharArray());
    }
    for (AuthInfo auth : authInfo) {
        if (auth.matchingHost(getRequestingURL())) {
            return new PasswordAuthentication(auth.getUser(), auth.getPassword().toCharArray());
        }
    }
    return null;
}
 
Example 9
Source File: HttpCallerInfo.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor an un-schemed object for proxy access.
 */
public HttpCallerInfo(URL url, String host, int port) {
    this.url= url;
    this.host = host;
    this.port = port;
    prompt = "";
    addr = null;
    protocol = url.getProtocol();
    authType = RequestorType.PROXY;
    scheme = "";
}
 
Example 10
Source File: NegotiateAuthentication.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
* Constructor used for both WWW and proxy entries.
* @param hci a schemed object.
*/
public NegotiateAuthentication(HttpCallerInfo hci) {
    super(RequestorType.PROXY==hci.authType ? PROXY_AUTHENTICATION : SERVER_AUTHENTICATION,
          hci.scheme.equalsIgnoreCase("Negotiate") ? NEGOTIATE : KERBEROS,
          hci.url,
          "");
    this.hci = hci;
}
 
Example 11
Source File: NegotiateAuthentication.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
* Constructor used for both WWW and proxy entries.
* @param hci a schemed object.
*/
public NegotiateAuthentication(HttpCallerInfo hci) {
    super(RequestorType.PROXY==hci.authType ? PROXY_AUTHENTICATION : SERVER_AUTHENTICATION,
          hci.scheme.equalsIgnoreCase("Negotiate") ? NEGOTIATE : KERBEROS,
          hci.url,
          "");
    this.hci = hci;
}
 
Example 12
Source File: HttpCallerInfo.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor an un-schemed object for proxy access.
 */
public HttpCallerInfo(URL url, String host, int port) {
    this.url= url;
    this.host = host;
    this.port = port;
    prompt = "";
    addr = null;
    protocol = url.getProtocol();
    authType = RequestorType.PROXY;
    scheme = "";
}
 
Example 13
Source File: DefaultAuthenticator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected PasswordAuthentication getPasswordAuthentication() {
    //If user sets proxy user and passwd and the RequestType is from proxy server then create
    // PasswordAuthentication using proxyUser and proxyPasswd;
    if ((getRequestorType() == RequestorType.PROXY) && proxyUser != null && proxyPasswd != null) {
        return new PasswordAuthentication(proxyUser, proxyPasswd.toCharArray());
    }
    for (AuthInfo auth : authInfo) {
        if (auth.matchingHost(getRequestingURL())) {
            return new PasswordAuthentication(auth.getUser(), auth.getPassword().toCharArray());
        }
    }
    return null;
}
 
Example 14
Source File: DefaultAuthenticator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected PasswordAuthentication getPasswordAuthentication() {
    //If user sets proxy user and passwd and the RequestType is from proxy server then create
    // PasswordAuthentication using proxyUser and proxyPasswd;
    if ((getRequestorType() == RequestorType.PROXY) && proxyUser != null && proxyPasswd != null) {
        return new PasswordAuthentication(proxyUser, proxyPasswd.toCharArray());
    }
    for (AuthInfo auth : authInfo) {
        if (auth.matchingHost(getRequestingURL())) {
            return new PasswordAuthentication(auth.getUser(), auth.getPassword().toCharArray());
        }
    }
    return null;
}
 
Example 15
Source File: NegotiateAuthentication.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
* Constructor used for both WWW and proxy entries.
* @param hci a schemed object.
*/
public NegotiateAuthentication(HttpCallerInfo hci) {
    super(RequestorType.PROXY==hci.authType ? PROXY_AUTHENTICATION : SERVER_AUTHENTICATION,
          hci.scheme.equalsIgnoreCase("Negotiate") ? NEGOTIATE : KERBEROS,
          hci.url,
          "");
    this.hci = hci;
}
 
Example 16
Source File: NegotiateAuthentication.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
* Constructor used for both WWW and proxy entries.
* @param hci a schemed object.
*/
public NegotiateAuthentication(HttpCallerInfo hci) {
    super(RequestorType.PROXY==hci.authType ? PROXY_AUTHENTICATION : SERVER_AUTHENTICATION,
          hci.scheme.equalsIgnoreCase("Negotiate") ? NEGOTIATE : KERBEROS,
          hci.url,
          "");
    this.hci = hci;
}
 
Example 17
Source File: DefaultAuthenticator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected PasswordAuthentication getPasswordAuthentication() {
    //If user sets proxy user and passwd and the RequestType is from proxy server then create
    // PasswordAuthentication using proxyUser and proxyPasswd;
    if ((getRequestorType() == RequestorType.PROXY) && proxyUser != null && proxyPasswd != null) {
        return new PasswordAuthentication(proxyUser, proxyPasswd.toCharArray());
    }
    for (AuthInfo auth : authInfo) {
        if (auth.matchingHost(getRequestingURL())) {
            return new PasswordAuthentication(auth.getUser(), auth.getPassword().toCharArray());
        }
    }
    return null;
}
 
Example 18
Source File: HttpCallerInfo.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor an un-schemed object for proxy access.
 */
public HttpCallerInfo(URL url, String host, int port) {
    this.url= url;
    this.host = host;
    this.port = port;
    prompt = "";
    addr = null;
    protocol = url.getProtocol();
    authType = RequestorType.PROXY;
    scheme = "";
}
 
Example 19
Source File: NegotiateAuthentication.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
* Constructor used for both WWW and proxy entries.
* @param hci a schemed object.
*/
public NegotiateAuthentication(HttpCallerInfo hci) {
    super(RequestorType.PROXY==hci.authType ? PROXY_AUTHENTICATION : SERVER_AUTHENTICATION,
          hci.scheme.equalsIgnoreCase("Negotiate") ? NEGOTIATE : KERBEROS,
          hci.url,
          "");
    this.hci = hci;
}
 
Example 20
Source File: DefaultAuthenticator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected PasswordAuthentication getPasswordAuthentication() {
    //If user sets proxy user and passwd and the RequestType is from proxy server then create
    // PasswordAuthentication using proxyUser and proxyPasswd;
    if ((getRequestorType() == RequestorType.PROXY) && proxyUser != null && proxyPasswd != null) {
        return new PasswordAuthentication(proxyUser, proxyPasswd.toCharArray());
    }
    for (AuthInfo auth : authInfo) {
        if (auth.matchingHost(getRequestingURL())) {
            return new PasswordAuthentication(auth.getUser(), auth.getPassword().toCharArray());
        }
    }
    return null;
}