1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 package org.apache.commons.httpclient.auth;
31
32 import org.apache.commons.httpclient.Credentials;
33
34 /***
35 * <p>
36 * Credentials provider interface can be used to provide {@link
37 * org.apache.commons.httpclient.HttpMethod HTTP method} with a means
38 * to request authentication credentials if no credentials have been given
39 * or given credentials are incorrect.
40 * </p>
41 *
42 * Classes implementing this interface must synchronize access to shared
43 * data as methods of this interfrace may be executed from multiple threads
44 *
45 * @author Ortwin Glueck
46 * @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
47 *
48 * @since 3.0
49 */
50 public interface CredentialsProvider {
51
52 /***
53 * Sets the credentials provider parameter.
54 * <p>
55 * This parameter expects a value of type {@link CredentialsProvider}.
56 * </p>
57 */
58 public static final String PROVIDER = "http.authentication.credential-provider";
59
60 /***
61 * Requests additional {@link Credentials authentication credentials}.
62 *
63 * @param scheme the {@link AuthScheme authentication scheme}
64 * @param host the authentication host
65 * @param port the port of the authentication host
66 * @param proxy <tt>true</tt> if authenticating with a proxy,
67 * <tt>false</tt> otherwise
68 */
69 public Credentials getCredentials(
70 final AuthScheme scheme,
71 final String host,
72 int port,
73 boolean proxy) throws CredentialsNotAvailableException;
74
75 }