Package org.apache.hadoop.lib.service

Examples of org.apache.hadoop.lib.service.DelegationTokenManager.verifyToken()


    server.setAuthority(new InetSocketAddress(InetAddress.getLocalHost(), 14000));
    server.init();
    DelegationTokenManager tm = server.get(DelegationTokenManager.class);
    Token token = tm.createToken(UserGroupInformation.getCurrentUser(), "foo");
    Assert.assertNotNull(token);
    tm.verifyToken(token);
    Assert.assertTrue(tm.renewToken(token, "foo") > System.currentTimeMillis());
    tm.cancelToken(token, "foo");
    try {
      tm.verifyToken(token);
      Assert.fail();
View Full Code Here


    Assert.assertNotNull(token);
    tm.verifyToken(token);
    Assert.assertTrue(tm.renewToken(token, "foo") > System.currentTimeMillis());
    tm.cancelToken(token, "foo");
    try {
      tm.verifyToken(token);
      Assert.fail();
    } catch (DelegationTokenManagerException ex) {
      //NOP
    } catch (Exception ex) {
      Assert.fail();
View Full Code Here

        Token<DelegationTokenIdentifier> dt =
          new Token<DelegationTokenIdentifier>();
        dt.decodeFromUrlString(delegationParam);
        DelegationTokenManager tokenManager =
          HttpFSServerWebApp.get().get(DelegationTokenManager.class);
        UserGroupInformation ugi = tokenManager.verifyToken(dt);
        final String shortName = ugi.getShortUserName();

        // creating a ephemeral token
        token = new AuthenticationToken(shortName, ugi.getUserName(),
                                        getType());
View Full Code Here

    server.setAuthority(new InetSocketAddress(InetAddress.getLocalHost(), 14000));
    server.init();
    DelegationTokenManager tm = server.get(DelegationTokenManager.class);
    Token token = tm.createToken(UserGroupInformation.getCurrentUser(), "foo");
    Assert.assertNotNull(token);
    tm.verifyToken(token);
    Assert.assertTrue(tm.renewToken(token, "foo") > System.currentTimeMillis());
    tm.cancelToken(token, "foo");
    try {
      tm.verifyToken(token);
      Assert.fail();
View Full Code Here

    Assert.assertNotNull(token);
    tm.verifyToken(token);
    Assert.assertTrue(tm.renewToken(token, "foo") > System.currentTimeMillis());
    tm.cancelToken(token, "foo");
    try {
      tm.verifyToken(token);
      Assert.fail();
    } catch (DelegationTokenManagerException ex) {
      //NOP
    } catch (Exception ex) {
      Assert.fail();
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.