Examples of AuthenticatedURL


Examples of org.apache.hadoop.security.authentication.client.AuthenticatedURL

  private HttpURLConnection getHttpUrlConnection(URL url)
      throws IOException {
    final HttpURLConnection conn;
    try {
      if (ugi.hasKerberosCredentials()) {
        conn = new AuthenticatedURL(AUTH).openConnection(url, authToken);
      } else {
        conn = (HttpURLConnection)url.openConnection();
      }
    } catch (AuthenticationException e) {
      throw new IOException("Authentication failed, url=" + url, e);
View Full Code Here

Examples of org.apache.hadoop.security.authentication.client.AuthenticatedURL

  private HttpURLConnection getConnection(URL url, String method) throws IOException {
    Class<? extends Authenticator> klass =
      getConf().getClass("httpfs.authenticator.class", HttpKerberosAuthenticator.class, Authenticator.class);
    Authenticator authenticator = ReflectionUtils.newInstance(klass, getConf());
    try {
      HttpURLConnection conn = new AuthenticatedURL(authenticator).openConnection(url, authToken);
      conn.setRequestMethod(method);
      if (method.equals(HTTP_POST) || method.equals(HTTP_PUT)) {
        conn.setDoOutput(true);
      }
      return conn;
View Full Code Here

Examples of org.apache.hadoop.security.authentication.client.AuthenticatedURL

    try {
      if (requireAuth) {
        LOG.debug("open AuthenticatedURL connection");
        UserGroupInformation.getCurrentUser().checkTGTAndReloginFromKeytab();
        final AuthenticatedURL.Token authToken = new AuthenticatedURL.Token();
        conn = new AuthenticatedURL(AUTH).openConnection(url, authToken);
      } else {
        LOG.debug("open URL connection");
        conn = (HttpURLConnection)url.openConnection();
      }
    } catch (AuthenticationException e) {
View Full Code Here

Examples of org.apache.hadoop.security.authentication.client.AuthenticatedURL

    try {
      URL clientUrl = new URL( targetUri.toString() + paramStr.toString() );
      //System.out.println( "Resolved query: " + clientUrl );
      AuthenticatedURL.Token token = new AuthenticatedURL.Token();
      KerberosAuthenticator authenticator = new KerberosAuthenticator();
      HttpURLConnection conn = new AuthenticatedURL( authenticator ).openConnection( clientUrl, token );
      //System.out.println( "STATUS=" + conn.getResponseCode() );
      InputStream input = conn.getInputStream();
      if( input != null ) {
        OutputStream output = response.getOutputStream();
        try {
View Full Code Here

Examples of org.apache.hadoop.security.authentication.client.AuthenticatedURL

  private HttpURLConnection getHttpUrlConnection(URL url)
      throws IOException, AuthenticationException {
    final HttpURLConnection conn;
    if (ugi.hasKerberosCredentials()) {
      conn = new AuthenticatedURL(AUTH).openConnection(url, authToken);
    } else {
      conn = (HttpURLConnection)url.openConnection();
    }
    return conn;
  }
View Full Code Here

Examples of org.apache.hadoop.security.authentication.client.AuthenticatedURL

    if (!UserGroupInformation.isSecurityEnabled() || useKsslAuth) {
      return url.openConnection();
    } else {
      AuthenticatedURL.Token token = new AuthenticatedURL.Token();
      try {
        return new AuthenticatedURL().openConnection(url, token);
      } catch (AuthenticationException e) {
        throw new IOException("Exception trying to open authenticated connection to "
            + url, e);
      }
    }
View Full Code Here

Examples of org.apache.hadoop.security.authentication.client.AuthenticatedURL

  private HttpURLConnection getHttpUrlConnection(URL url)
      throws IOException {
    final HttpURLConnection conn;
    try {
      if (ugi.hasKerberosCredentials()) {
        conn = new AuthenticatedURL(AUTH).openConnection(url, authToken);
      } else {
        conn = (HttpURLConnection)url.openConnection();
      }
    } catch (AuthenticationException e) {
      throw new IOException("Authentication failed, url=" + url, e);
View Full Code Here

Examples of org.apache.hadoop.security.authentication.client.AuthenticatedURL

  private HttpURLConnection getHttpUrlConnection(URL url)
      throws IOException, AuthenticationException {
    final HttpURLConnection conn;
    if (ugi.hasKerberosCredentials()) {
      conn = new AuthenticatedURL(AUTH).openConnection(url, authToken);
    } else {
      conn = (HttpURLConnection)url.openConnection();
    }
    return conn;
  }
View Full Code Here

Examples of org.apache.hadoop.security.authentication.client.AuthenticatedURL

  private HttpURLConnection getHttpUrlConnection(URL url)
      throws IOException, AuthenticationException {
    final HttpURLConnection conn;
    if (ugi.hasKerberosCredentials()) {
      conn = new AuthenticatedURL(AUTH).openConnection(url, authToken);
    } else {
      conn = (HttpURLConnection)url.openConnection();
    }
    return conn;
  }
View Full Code Here

Examples of org.apache.hadoop.security.authentication.client.AuthenticatedURL

        }

        if (!currentToken.isSet()) {
            Authenticator authenticator = getAuthenticator();
            try {
                new AuthenticatedURL(authenticator).openConnection(url, currentToken);
            }
            catch (AuthenticationException ex) {
                AUTH_TOKEN_CACHE_FILE.delete();
                throw new OozieClientException(OozieClientException.AUTHENTICATION,
                                               "Could not authenticate, " + ex.getMessage(), ex);
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.