comparison src/com/trilead/ssh2/InteractiveCallback.java @ 0:0ce5cc452d02

initial version
author Carl Byington <carl@five-ten-sg.com>
date Thu, 22 May 2014 10:41:19 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0ce5cc452d02
1
2 package com.trilead.ssh2;
3
4 /**
5 * An <code>InteractiveCallback</code> is used to respond to challenges sent
6 * by the server if authentication mode "keyboard-interactive" is selected.
7 *
8 * @see Connection#authenticateWithKeyboardInteractive(String,
9 * String[], InteractiveCallback)
10 *
11 * @author Christian Plattner, plattner@trilead.com
12 * @version $Id: InteractiveCallback.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $
13 */
14
15 public interface InteractiveCallback {
16 /**
17 * This callback interface is used during a "keyboard-interactive"
18 * authentication. Every time the server sends a set of challenges (however,
19 * most often just one challenge at a time), this callback function will be
20 * called to give your application a chance to talk to the user and to
21 * determine the response(s).
22 * <p>
23 * Some copy-paste information from the standard: a command line interface
24 * (CLI) client SHOULD print the name and instruction (if non-empty), adding
25 * newlines. Then for each prompt in turn, the client SHOULD display the
26 * prompt and read the user input. The name and instruction fields MAY be
27 * empty strings, the client MUST be prepared to handle this correctly. The
28 * prompt field(s) MUST NOT be empty strings.
29 * <p>
30 * Please refer to draft-ietf-secsh-auth-kbdinteract-XX.txt for the details.
31 * <p>
32 * Note: clients SHOULD use control character filtering as discussed in
33 * RFC4251 to avoid attacks by including
34 * terminal control characters in the fields to be displayed.
35 *
36 * @param name
37 * the name String sent by the server.
38 * @param instruction
39 * the instruction String sent by the server.
40 * @param numPrompts
41 * number of prompts - may be zero (in this case, you should just
42 * return a String array of length zero).
43 * @param prompt
44 * an array (length <code>numPrompts</code>) of Strings
45 * @param echo
46 * an array (length <code>numPrompts</code>) of booleans. For
47 * each prompt, the corresponding echo field indicates whether or
48 * not the user input should be echoed as characters are typed.
49 * @return an array of reponses - the array size must match the parameter
50 * <code>numPrompts</code>.
51 */
52 public String[] replyToChallenge(String name, String instruction, int numPrompts, String[] prompt, boolean[] echo)
53 throws Exception;
54 }