Package org.apache.hadoop.security.authentication.client

Examples of org.apache.hadoop.security.authentication.client.AuthenticatedURL.openConnection()


    params.put(TimelineAuthenticationConsts.RENEWER_PARAM, renewer);
    url = appendParams(url, params);
    AuthenticatedURL aUrl =
        new AuthenticatedURL(new TimelineAuthenticator());
    try {
      HttpURLConnection conn = aUrl.openConnection(url, token);
      conn.setRequestMethod(op.getHttpMethod());
      TimelineDelegationTokenResponse dtRes = validateAndParseResponse(conn);
      if (!dtRes.getType().equals(
          TimelineAuthenticationConsts.DELEGATION_TOKEN_URL)) {
        throw new IOException("The response content is not expected: "
View Full Code Here


        dToken.encodeToUrlString());
    url = appendParams(url, params);
    AuthenticatedURL aUrl =
        new AuthenticatedURL(new TimelineAuthenticator());
    try {
      HttpURLConnection conn = aUrl.openConnection(url, token);
      conn.setRequestMethod(
          TimelineDelegationTokenOperation.RENEWDELEGATIONTOKEN.getHttpMethod());
      TimelineDelegationTokenResponse dtRes = validateAndParseResponse(conn);
      if (!dtRes.getType().equals(
          TimelineAuthenticationConsts.DELEGATION_TOKEN_EXPIRATION_TIME)) {
View Full Code Here

        dToken.encodeToUrlString());
    url = appendParams(url, params);
    AuthenticatedURL aUrl =
        new AuthenticatedURL(new TimelineAuthenticator());
    try {
      HttpURLConnection conn = aUrl.openConnection(url, token);
      conn.setRequestMethod(TimelineDelegationTokenOperation.CANCELDELEGATIONTOKEN
          .getHttpMethod());
      validateAndParseResponse(conn);
    } catch (AuthenticationException ex) {
      throw new IOException(ex.toString(), ex);
View Full Code Here

    params.put(RENEWER_PARAM,renewer);
    URL url = HttpFSUtils.createHttpURL(new Path(fsURI), params);
    AuthenticatedURL aUrl =
      new AuthenticatedURL(new HttpFSKerberosAuthenticator());
    try {
      HttpURLConnection conn = aUrl.openConnection(url, token);
      conn.setRequestMethod(op.getHttpMethod());
      HttpFSUtils.validateResponse(conn, HttpURLConnection.HTTP_OK);
      JSONObject json = (JSONObject) ((JSONObject)
        HttpFSUtils.jsonParse(conn)).get(DELEGATION_TOKEN_JSON);
      String tokenStr = (String)
View Full Code Here

    params.put(TOKEN_PARAM, dToken.encodeToUrlString());
    URL url = HttpFSUtils.createHttpURL(new Path(fsURI), params);
    AuthenticatedURL aUrl =
      new AuthenticatedURL(new HttpFSKerberosAuthenticator());
    try {
      HttpURLConnection conn = aUrl.openConnection(url, token);
      conn.setRequestMethod(
        DelegationTokenOperation.RENEWDELEGATIONTOKEN.getHttpMethod());
      HttpFSUtils.validateResponse(conn, HttpURLConnection.HTTP_OK);
      JSONObject json = (JSONObject) ((JSONObject)
        HttpFSUtils.jsonParse(conn)).get(DELEGATION_TOKEN_JSON);
View Full Code Here

    params.put(TOKEN_PARAM, dToken.encodeToUrlString());
    URL url = HttpFSUtils.createHttpURL(new Path(fsURI), params);
    AuthenticatedURL aUrl =
      new AuthenticatedURL(new HttpFSKerberosAuthenticator());
    try {
      HttpURLConnection conn = aUrl.openConnection(url, token);
      conn.setRequestMethod(
        DelegationTokenOperation.CANCELDELEGATIONTOKEN.getHttpMethod());
      HttpFSUtils.validateResponse(conn, HttpURLConnection.HTTP_OK);
    } catch (AuthenticationException ex) {
      throw new IOException(ex.toString(), ex);
View Full Code Here

    params.put(RENEWER_PARAM,renewer);
    URL url = HttpFSUtils.createHttpURL(new Path(fsURI), params);
    AuthenticatedURL aUrl =
      new AuthenticatedURL(new HttpFSKerberosAuthenticator());
    try {
      HttpURLConnection conn = aUrl.openConnection(url, token);
      conn.setRequestMethod(op.getHttpMethod());
      HttpFSUtils.validateResponse(conn, HttpURLConnection.HTTP_OK);
      JSONObject json = (JSONObject) ((JSONObject)
        HttpFSUtils.jsonParse(conn)).get(DELEGATION_TOKEN_JSON);
      String tokenStr = (String)
View Full Code Here

    params.put(TOKEN_PARAM, dToken.encodeToUrlString());
    URL url = HttpFSUtils.createHttpURL(new Path(fsURI), params);
    AuthenticatedURL aUrl =
      new AuthenticatedURL(new HttpFSKerberosAuthenticator());
    try {
      HttpURLConnection conn = aUrl.openConnection(url, token);
      conn.setRequestMethod(
        DelegationTokenOperation.RENEWDELEGATIONTOKEN.getHttpMethod());
      HttpFSUtils.validateResponse(conn, HttpURLConnection.HTTP_OK);
      JSONObject json = (JSONObject) ((JSONObject)
        HttpFSUtils.jsonParse(conn)).get(DELEGATION_TOKEN_JSON);
View Full Code Here

    params.put(TOKEN_PARAM, dToken.encodeToUrlString());
    URL url = HttpFSUtils.createHttpURL(new Path(fsURI), params);
    AuthenticatedURL aUrl =
      new AuthenticatedURL(new HttpFSKerberosAuthenticator());
    try {
      HttpURLConnection conn = aUrl.openConnection(url, token);
      conn.setRequestMethod(
        DelegationTokenOperation.CANCELDELEGATIONTOKEN.getHttpMethod());
      HttpFSUtils.validateResponse(conn, HttpURLConnection.HTTP_OK);
    } catch (AuthenticationException ex) {
      throw new IOException(ex.toString(), ex);
View Full Code Here

      public Void call() throws Exception {
        URL url = new URL(TestJettyHelper.getJettyURL(),
                          "/webhdfs/v1/?op=GETHOMEDIRECTORY");
        AuthenticatedURL aUrl = new AuthenticatedURL();
        AuthenticatedURL.Token aToken = new AuthenticatedURL.Token();
        HttpURLConnection conn = aUrl.openConnection(url, aToken);
        Assert.assertEquals(conn.getResponseCode(), HttpURLConnection.HTTP_OK);
        return null;
      }
    });
  }
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.