150 |
* @param port The port requesting authentication |
* @param port The port requesting authentication |
151 |
* @param protocol The protocol requesting authentication |
* @param protocol The protocol requesting authentication |
152 |
* @param prompt The prompt to display to the user when requesting |
* @param prompt The prompt to display to the user when requesting |
153 |
authentication info |
* authentication info |
154 |
* @param scheme The authentication scheme in use |
* @param scheme The authentication scheme in use |
155 |
* |
* |
156 |
* @return A <code>PasswordAuthentication</code> object with the user's |
* @return A <code>PasswordAuthentication</code> object with the user's |
169 |
} |
} |
170 |
|
|
171 |
/** |
/** |
172 |
* @since 1.4 |
* This method is called whenever a username and password for a given |
173 |
*/ |
* network operation is required. First, a security check is made to see |
174 |
|
* if the caller has the "requestPasswordAuthentication" |
175 |
|
* permission. If not, the method thows an exception. If there is no |
176 |
|
* default <code>Authenticator</code> object, the method then returns |
177 |
|
* <code>null</code>. Otherwise, the default authenticators's instance |
178 |
|
* variables are initialized and it's <code>getPasswordAuthentication</code> |
179 |
|
* method is called to get the actual authentication information to return. |
180 |
|
* This method is the preferred one as it can be used with hostname |
181 |
|
* when addr is unknown. |
182 |
|
* |
183 |
|
* @param host The hostname requesting authentication |
184 |
|
* @param addr The address requesting authentication |
185 |
|
* @param port The port requesting authentication |
186 |
|
* @param protocol The protocol requesting authentication |
187 |
|
* @param prompt The prompt to display to the user when requesting |
188 |
|
* authentication info |
189 |
|
* @param scheme The authentication scheme in use |
190 |
|
* |
191 |
|
* @return A <code>PasswordAuthentication</code> object with the user's |
192 |
|
* authentication info. |
193 |
|
* |
194 |
|
* @exception SecurityException If the caller does not have permission to |
195 |
|
* perform this operation |
196 |
|
* |
197 |
|
* @since 1.4 |
198 |
|
*/ |
199 |
public static PasswordAuthentication |
public static PasswordAuthentication |
200 |
requestPasswordAuthentication(String host, InetAddress addr, int port, |
requestPasswordAuthentication(String host, InetAddress addr, int port, |
201 |
String protocol, String prompt, String scheme) |
String protocol, String prompt, String scheme) |
219 |
} |
} |
220 |
|
|
221 |
/** |
/** |
222 |
|
* Returns the hostname of the host or proxy requesting authorization, |
223 |
|
* or null if not available. |
224 |
|
* |
225 |
* @since 1.4 |
* @since 1.4 |
226 |
*/ |
*/ |
227 |
protected final String getRequestingHost() |
protected final String getRequestingHost() |