/** * Creates a new limited use authentication token with the given Subject * and the default lifetime. * @param subject the Subject to associated with this token when it is consumed * @return */ public String createToken(final Subject subject) { return createToken(subject, DEFAULT_TOKEN_LIFETIME); }
/** * Creates a new limited use authentication token with the default * lifetime. * @return auth token */ public String createToken() { return createToken(DEFAULT_TOKEN_LIFETIME); }
/** * Creates a new limited use authentication token with the default * lifetime. * @return auth token */ public String createToken() { return createToken(DEFAULT_TOKEN_LIFETIME); }
/** * Creates a new limited use authentication token with the given Subject * and the default lifetime. * @param subject the Subject to associated with this token when it is consumed * @return */ public String createToken(final Subject subject) { return createToken(subject, DEFAULT_TOKEN_LIFETIME); }
/** * Creates a new limited use authentication token with the specified * lifetime but no Subject. * @param lifetime how long each use of the token extends its lifetime * @return */ public String createToken(final long lifetime) { return createToken (new Subject(), lifetime); }
/** * Creates a new limited use authentication token with the specified * lifetime but no Subject. * @param lifetime how long each use of the token extends its lifetime * @return */ public String createToken(final long lifetime) { return createToken (new Subject(), lifetime); }
public int runAdminCommandOnNode(Node node, StringBuilder output, boolean waitForReaderThreads, List<String> args, AdminCommandContext context) throws SSHCommandExecutionException, ProcessManagerException, UnsupportedOperationException, IllegalArgumentException { if (node == null) { throw new IllegalArgumentException("Node is null"); } final List<String> stdinLines = new ArrayList<String>(); stdinLines.add(AsadminInput.versionSpecifier()); stdinLines.add(AUTH_TOKEN_STDIN_LINE_PREFIX + authTokenManager.createToken(context.getSubject())); args.add(0, "--interactive=false"); // No prompting! if (node.isLocal()) { return runAdminCommandOnLocalNode(node, output, waitForReaderThreads, args, stdinLines); } else { return runAdminCommandOnRemoteNode(node, output, args, stdinLines); } }
customizedProperties.put("AuthToken", tokenMgr.createToken(30L*60L*1000L)); customizedProperties.put("StartToken", tokenMgr.createToken(30L*60L*1000L)); File customization =new File(customizationDir, "customization");
customizedProperties.put("AuthToken", authTokenManager.createToken()); customizedProperties.put("AuthToken2", authTokenManager.createToken()); customizedProperties.put("StartToken", authTokenManager.createToken());