Class AuthenticatedURL

java.lang.Object
org.apache.hadoop.security.authentication.client.AuthenticatedURL

public class AuthenticatedURL extends Object
The AuthenticatedURL class enables the use of the JDK URL class against HTTP endpoints protected with the AuthenticationFilter.

The authentication mechanisms supported by default are Hadoop Simple authentication (also known as pseudo authentication) and Kerberos SPNEGO authentication.

Additional authentication mechanisms can be supported via Authenticator implementations.

The default Authenticator is the KerberosAuthenticator class which supports automatic fallback from Kerberos SPNEGO to Hadoop Simple authentication.

AuthenticatedURL instances are not thread-safe.

The usage pattern of the AuthenticatedURL is:


 // establishing an initial connection

 URL url = new URL("http://foo:8080/bar");
 AuthenticatedURL.Token token = new AuthenticatedURL.Token();
 AuthenticatedURL aUrl = new AuthenticatedURL();
 HttpURLConnection conn = new AuthenticatedURL().openConnection(url, token);
 ....
 // use the 'conn' instance
 ....

 // establishing a follow up connection using a token from the previous connection

 HttpURLConnection conn = new AuthenticatedURL().openConnection(url, token);
 ....
 // use the 'conn' instance
 ....