Mercurial > 510Connectbot
annotate src/ch/ethz/ssh2/ServerAuthenticationCallback.java @ 357:46c2115ae1c8
update jzlib to a21be20213d66eff15904d925e9b721956a01ef7
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Fri, 01 Aug 2014 13:34:58 -0700 |
parents | 071eccdff8ea |
children |
rev | line source |
---|---|
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
1 /* |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012-2013 Christian Plattner. All rights reserved. |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
3 * Please refer to the LICENSE.txt for licensing details. |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
4 */ |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
5 |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
6 package ch.ethz.ssh2; |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
7 |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
8 /** |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
9 * A callback used during the authentication phase (see RFC 4252) when |
307 | 10 * implementing a SSH server. |
11 * | |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
12 * @author Christian Plattner |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
13 * @version 2.50, 03/15/10 |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
14 */ |
307 | 15 public interface ServerAuthenticationCallback { |
16 /** | |
17 * The method name for host-based authentication. | |
18 */ | |
19 public final String METHOD_HOSTBASED = "hostbased"; | |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
20 |
307 | 21 /** |
22 * The method name for public-key authentication. | |
23 */ | |
24 public final String METHOD_PUBLICKEY = "publickey"; | |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
25 |
307 | 26 /** |
27 * The method name for password authentication. | |
28 */ | |
29 public final String METHOD_PASSWORD = "password"; | |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
30 |
307 | 31 /** |
32 * Called when the client enters authentication. | |
33 * This gives you the chance to set a custom authentication banner | |
34 * for this SSH-2 session. This is the first method called in this interface. | |
35 * It will only called at most once per <code>ServerConnection</code>. | |
36 * | |
37 * @param sc The corresponding <code>ServerConnection</code> | |
38 * @return The authentication banner or <code>NULL</code> in case no banner should be send. | |
39 */ | |
40 public String initAuthentication(ServerConnection sc); | |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
41 |
307 | 42 /** |
43 * Return the authentication methods that are currently available to the client. | |
44 * Be prepared to return this information at any time during the authentication procedure. | |
45 * <p/> | |
46 * The returned name-list of 'method names' (see RFC4252) indicate the authentication methods | |
47 * that may productively continue the authentication dialog. | |
48 * </p> | |
49 * It is RECOMMENDED that servers only include those 'method name' | |
50 * values in the name-list that are actually useful. However, it is not | |
51 * illegal to include 'method name' values that cannot be used to | |
52 * authenticate the user. | |
53 * <p/> | |
54 * Already successfully completed authentications SHOULD NOT be included | |
55 * in the name-list, unless they should be performed again for some reason. | |
56 * | |
57 * @see #METHOD_HOSTBASED | |
58 * @see #METHOD_PASSWORD | |
59 * @see #METHOD_PUBLICKEY | |
60 * | |
61 * @param sc | |
62 * @return A list of method names. | |
63 */ | |
64 public String[] getRemainingAuthMethods(ServerConnection sc); | |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
65 |
307 | 66 /** |
67 * Typically, this will be called be the client to get the list of | |
68 * authentication methods that can continue. You should simply return | |
69 * {@link AuthenticationResult#FAILURE}. | |
70 * | |
71 * @param sc | |
72 * @param username Name of the user that wants to log in with the "none" method. | |
73 * @return | |
74 */ | |
75 public AuthenticationResult authenticateWithNone(ServerConnection sc, String username); | |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
76 |
307 | 77 public AuthenticationResult authenticateWithPassword(ServerConnection sc, String username, String password); |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
78 |
307 | 79 /** |
80 * NOTE: Not implemented yet. | |
81 * | |
82 * @param sc | |
83 * @param username | |
84 * @param algorithm | |
85 * @param publickey | |
86 * @param signature | |
87 * @return | |
88 */ | |
89 public AuthenticationResult authenticateWithPublicKey(ServerConnection sc, String username, String algorithm, | |
90 byte[] publickey, byte[] signature); | |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
91 } |