42 // REMIND: Unless compatibility with sun.* API's from 1.2 to 2.0 is
43 // a goal, there's no reason to carry this forward into JDK 2.0.
44 @Deprecated
45 public interface HttpAuthenticator {
46
47
48 /**
49 * Indicate whether the specified authentication scheme is
50 * supported. In accordance with HTTP specifications, the
51 * scheme name should be checked in a case-insensitive fashion.
52 */
53
54 boolean schemeSupported (String scheme);
55
56 /**
57 * Returns the String that should be included in the HTTP
58 * <B>Authorization</B> field. Return null if no info was
59 * supplied or could be found.
60 * <P>
61 * Example:
62 * --> GET http://www.authorization-required.com/ HTTP/1.0
63 * <-- HTTP/1.0 403 Unauthorized
64 * <-- WWW-Authenticate: Basic realm="WallyWorld"
65 * call schemeSupported("Basic"); (return true)
66 * call authString(u, "Basic", "WallyWorld", null);
67 * return "QWadhgWERghghWERfdfQ=="
68 * --> GET http://www.authorization-required.com/ HTTP/1.0
69 * --> Authorization: Basic QWadhgWERghghWERfdfQ==
70 * <-- HTTP/1.0 200 OK
71 * <B> YAY!!!</B>
72 */
73
74 public String authString (URL u, String scheme, String realm);
75
76 }
|
42 // REMIND: Unless compatibility with sun.* API's from 1.2 to 2.0 is
43 // a goal, there's no reason to carry this forward into JDK 2.0.
44 @Deprecated
45 public interface HttpAuthenticator {
46
47
48 /**
49 * Indicate whether the specified authentication scheme is
50 * supported. In accordance with HTTP specifications, the
51 * scheme name should be checked in a case-insensitive fashion.
52 */
53
54 boolean schemeSupported (String scheme);
55
56 /**
57 * Returns the String that should be included in the HTTP
58 * <B>Authorization</B> field. Return null if no info was
59 * supplied or could be found.
60 * <P>
61 * Example:
62 * <pre>{@code
63 * --> GET http://www.authorization-required.com/ HTTP/1.0
64 * <-- HTTP/1.0 403 Unauthorized
65 * <-- WWW-Authenticate: Basic realm="WallyWorld"
66 * call schemeSupported("Basic"); (return true)
67 * call authString(u, "Basic", "WallyWorld", null);
68 * return "QWadhgWERghghWERfdfQ=="
69 * --> GET http://www.authorization-required.com/ HTTP/1.0
70 * --> Authorization: Basic QWadhgWERghghWERfdfQ==
71 * <-- HTTP/1.0 200 OK}
72 * <B> YAY!!!</B>
73 * </pre>
74 */
75
76 public String authString (URL u, String scheme, String realm);
77
78 }
|