blob: a83aa7b1a62b15a5db16aa903b1fd464900dc8db [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_292) on Tue Jun 15 06:01:16 GMT 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>AuthenticatedURL (Apache Hadoop Auth 3.3.1 API)</title>
<meta name="date" content="2021-06-15">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="AuthenticatedURL (Apache Hadoop Auth 3.3.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":10,"i2":9,"i3":9,"i4":10,"i5":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/AuthenticatedURL.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.Token.html" title="class in org.apache.hadoop.security.authentication.client"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/hadoop/security/authentication/client/AuthenticatedURL.html" target="_top">Frames</a></li>
<li><a href="AuthenticatedURL.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.hadoop.security.authentication.client</div>
<h2 title="Class AuthenticatedURL" class="title">Class AuthenticatedURL</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.hadoop.security.authentication.client.AuthenticatedURL</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">AuthenticatedURL</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">The <a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html" title="class in org.apache.hadoop.security.authentication.client"><code>AuthenticatedURL</code></a> class enables the use of the JDK <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net"><code>URL</code></a> class
against HTTP endpoints protected with the <a href="../../../../../../org/apache/hadoop/security/authentication/server/AuthenticationFilter.html" title="class in org.apache.hadoop.security.authentication.server"><code>AuthenticationFilter</code></a>.
<p>
The authentication mechanisms supported by default are Hadoop Simple authentication
(also known as pseudo authentication) and Kerberos SPNEGO authentication.
<p>
Additional authentication mechanisms can be supported via <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> implementations.
<p>
The default <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> is the <a href="../../../../../../org/apache/hadoop/security/authentication/client/KerberosAuthenticator.html" title="class in org.apache.hadoop.security.authentication.client"><code>KerberosAuthenticator</code></a> class which supports
automatic fallback from Kerberos SPNEGO to Hadoop Simple authentication.
<p>
<code>AuthenticatedURL</code> instances are not thread-safe.
<p>
The usage pattern of the <a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html" title="class in org.apache.hadoop.security.authentication.client"><code>AuthenticatedURL</code></a> is:
<pre>
// 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
....
</pre></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.Token.html" title="class in org.apache.hadoop.security.authentication.client">AuthenticatedURL.Token</a></span></code>
<div class="block">Client side authentication token.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html#AUTH_COOKIE">AUTH_COOKIE</a></span></code>
<div class="block">Name of the HTTP cookie used for the authentication token between the client and the server.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html#AuthenticatedURL--">AuthenticatedURL</a></span>()</code>
<div class="block">Creates an <a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html" title="class in org.apache.hadoop.security.authentication.client"><code>AuthenticatedURL</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html#AuthenticatedURL-org.apache.hadoop.security.authentication.client.Authenticator-">AuthenticatedURL</a></span>(<a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client">Authenticator</a>&nbsp;authenticator)</code>
<div class="block">Creates an <code>AuthenticatedURL</code>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html#AuthenticatedURL-org.apache.hadoop.security.authentication.client.Authenticator-org.apache.hadoop.security.authentication.client.ConnectionConfigurator-">AuthenticatedURL</a></span>(<a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client">Authenticator</a>&nbsp;authenticator,
<a href="../../../../../../org/apache/hadoop/security/authentication/client/ConnectionConfigurator.html" title="interface in org.apache.hadoop.security.authentication.client">ConnectionConfigurator</a>&nbsp;connConfigurator)</code>
<div class="block">Creates an <code>AuthenticatedURL</code>.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html#extractToken-java.net.HttpURLConnection-org.apache.hadoop.security.authentication.client.AuthenticatedURL.Token-">extractToken</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html?is-external=true" title="class or interface in java.net">HttpURLConnection</a>&nbsp;conn,
<a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.Token.html" title="class in org.apache.hadoop.security.authentication.client">AuthenticatedURL.Token</a>&nbsp;token)</code>
<div class="block">Helper method that extracts an authentication token received from a connection.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client">Authenticator</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html#getAuthenticator--">getAuthenticator</a></span>()</code>
<div class="block">Returns the <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> instance used by the
<code>AuthenticatedURL</code>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client">Authenticator</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html#getDefaultAuthenticator--">getDefaultAuthenticator</a></span>()</code>
<div class="block">Returns the default <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> class to use when an <a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html" title="class in org.apache.hadoop.security.authentication.client"><code>AuthenticatedURL</code></a> instance
is created without specifying an authenticator.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html#injectToken-java.net.HttpURLConnection-org.apache.hadoop.security.authentication.client.AuthenticatedURL.Token-">injectToken</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html?is-external=true" title="class or interface in java.net">HttpURLConnection</a>&nbsp;conn,
<a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.Token.html" title="class in org.apache.hadoop.security.authentication.client">AuthenticatedURL.Token</a>&nbsp;token)</code>
<div class="block">Helper method that injects an authentication token to send with a
connection.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html?is-external=true" title="class or interface in java.net">HttpURLConnection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html#openConnection-java.net.URL-org.apache.hadoop.security.authentication.client.AuthenticatedURL.Token-">openConnection</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a>&nbsp;url,
<a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.Token.html" title="class in org.apache.hadoop.security.authentication.client">AuthenticatedURL.Token</a>&nbsp;token)</code>
<div class="block">Returns an authenticated <a href="https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html?is-external=true" title="class or interface in java.net"><code>HttpURLConnection</code></a>.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html#setDefaultAuthenticator-java.lang.Class-">setDefaultAuthenticator</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client">Authenticator</a>&gt;&nbsp;authenticator)</code>
<div class="block">Sets the default <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> class to use when an <a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html" title="class in org.apache.hadoop.security.authentication.client"><code>AuthenticatedURL</code></a> instance
is created without specifying an authenticator.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="AUTH_COOKIE">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>AUTH_COOKIE</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> AUTH_COOKIE</pre>
<div class="block">Name of the HTTP cookie used for the authentication token between the client and the server.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.hadoop.security.authentication.client.AuthenticatedURL.AUTH_COOKIE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="AuthenticatedURL--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>AuthenticatedURL</h4>
<pre>public&nbsp;AuthenticatedURL()</pre>
<div class="block">Creates an <a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html" title="class in org.apache.hadoop.security.authentication.client"><code>AuthenticatedURL</code></a>.</div>
</li>
</ul>
<a name="AuthenticatedURL-org.apache.hadoop.security.authentication.client.Authenticator-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>AuthenticatedURL</h4>
<pre>public&nbsp;AuthenticatedURL(<a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client">Authenticator</a>&nbsp;authenticator)</pre>
<div class="block">Creates an <code>AuthenticatedURL</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>authenticator</code> - the <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> instance to use, if <code>null</code> a <a href="../../../../../../org/apache/hadoop/security/authentication/client/KerberosAuthenticator.html" title="class in org.apache.hadoop.security.authentication.client"><code>KerberosAuthenticator</code></a> is used.</dd>
</dl>
</li>
</ul>
<a name="AuthenticatedURL-org.apache.hadoop.security.authentication.client.Authenticator-org.apache.hadoop.security.authentication.client.ConnectionConfigurator-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>AuthenticatedURL</h4>
<pre>public&nbsp;AuthenticatedURL(<a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client">Authenticator</a>&nbsp;authenticator,
<a href="../../../../../../org/apache/hadoop/security/authentication/client/ConnectionConfigurator.html" title="interface in org.apache.hadoop.security.authentication.client">ConnectionConfigurator</a>&nbsp;connConfigurator)</pre>
<div class="block">Creates an <code>AuthenticatedURL</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>authenticator</code> - the <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> instance to use, if <code>null</code> a <a href="../../../../../../org/apache/hadoop/security/authentication/client/KerberosAuthenticator.html" title="class in org.apache.hadoop.security.authentication.client"><code>KerberosAuthenticator</code></a> is used.</dd>
<dd><code>connConfigurator</code> - a connection configurator.</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="setDefaultAuthenticator-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDefaultAuthenticator</h4>
<pre>public static&nbsp;void&nbsp;setDefaultAuthenticator(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client">Authenticator</a>&gt;&nbsp;authenticator)</pre>
<div class="block">Sets the default <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> class to use when an <a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html" title="class in org.apache.hadoop.security.authentication.client"><code>AuthenticatedURL</code></a> instance
is created without specifying an authenticator.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>authenticator</code> - the authenticator class to use as default.</dd>
</dl>
</li>
</ul>
<a name="getDefaultAuthenticator--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDefaultAuthenticator</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client">Authenticator</a>&gt;&nbsp;getDefaultAuthenticator()</pre>
<div class="block">Returns the default <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> class to use when an <a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.html" title="class in org.apache.hadoop.security.authentication.client"><code>AuthenticatedURL</code></a> instance
is created without specifying an authenticator.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the authenticator class to use as default.</dd>
</dl>
</li>
</ul>
<a name="getAuthenticator--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAuthenticator</h4>
<pre>protected&nbsp;<a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client">Authenticator</a>&nbsp;getAuthenticator()</pre>
<div class="block">Returns the <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> instance used by the
<code>AuthenticatedURL</code>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> instance</dd>
</dl>
</li>
</ul>
<a name="openConnection-java.net.URL-org.apache.hadoop.security.authentication.client.AuthenticatedURL.Token-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>openConnection</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html?is-external=true" title="class or interface in java.net">HttpURLConnection</a>&nbsp;openConnection(<a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a>&nbsp;url,
<a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.Token.html" title="class in org.apache.hadoop.security.authentication.client">AuthenticatedURL.Token</a>&nbsp;token)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticationException.html" title="class in org.apache.hadoop.security.authentication.client">AuthenticationException</a></pre>
<div class="block">Returns an authenticated <a href="https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html?is-external=true" title="class or interface in java.net"><code>HttpURLConnection</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>url</code> - the URL to connect to. Only HTTP/S URLs are supported.</dd>
<dd><code>token</code> - the authentication token being used for the user.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an authenticated <a href="https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html?is-external=true" title="class or interface in java.net"><code>HttpURLConnection</code></a>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an IO error occurred.</dd>
<dd><code><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticationException.html" title="class in org.apache.hadoop.security.authentication.client">AuthenticationException</a></code> - if an authentication exception occurred.</dd>
</dl>
</li>
</ul>
<a name="injectToken-java.net.HttpURLConnection-org.apache.hadoop.security.authentication.client.AuthenticatedURL.Token-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>injectToken</h4>
<pre>public static&nbsp;void&nbsp;injectToken(<a href="https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html?is-external=true" title="class or interface in java.net">HttpURLConnection</a>&nbsp;conn,
<a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.Token.html" title="class in org.apache.hadoop.security.authentication.client">AuthenticatedURL.Token</a>&nbsp;token)</pre>
<div class="block">Helper method that injects an authentication token to send with a
connection. Callers should prefer using
<a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.Token.html#openConnection-java.net.URL-org.apache.hadoop.security.authentication.client.ConnectionConfigurator-"><code>AuthenticatedURL.Token.openConnection(URL, ConnectionConfigurator)</code></a> which
automatically manages authentication tokens.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>conn</code> - connection to inject the authentication token into.</dd>
<dd><code>token</code> - authentication token to inject.</dd>
</dl>
</li>
</ul>
<a name="extractToken-java.net.HttpURLConnection-org.apache.hadoop.security.authentication.client.AuthenticatedURL.Token-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>extractToken</h4>
<pre>public static&nbsp;void&nbsp;extractToken(<a href="https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html?is-external=true" title="class or interface in java.net">HttpURLConnection</a>&nbsp;conn,
<a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.Token.html" title="class in org.apache.hadoop.security.authentication.client">AuthenticatedURL.Token</a>&nbsp;token)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticationException.html" title="class in org.apache.hadoop.security.authentication.client">AuthenticationException</a></pre>
<div class="block">Helper method that extracts an authentication token received from a connection.
<p>
This method is used by <a href="../../../../../../org/apache/hadoop/security/authentication/client/Authenticator.html" title="interface in org.apache.hadoop.security.authentication.client"><code>Authenticator</code></a> implementations.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>conn</code> - connection to extract the authentication token from.</dd>
<dd><code>token</code> - the authentication token.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an IO error occurred.</dd>
<dd><code><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticationException.html" title="class in org.apache.hadoop.security.authentication.client">AuthenticationException</a></code> - if an authentication exception occurred.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/AuthenticatedURL.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../../../../org/apache/hadoop/security/authentication/client/AuthenticatedURL.Token.html" title="class in org.apache.hadoop.security.authentication.client"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/hadoop/security/authentication/client/AuthenticatedURL.html" target="_top">Frames</a></li>
<li><a href="AuthenticatedURL.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2008&#x2013;2021 <a href="https://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>