blob: ae24eccef9bfdd926390a0897364e7ef71fd2eec [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.11) on Mon Oct 11 11:08:51 CDT 2021 -->
<title>IdentityService (Eclipse Jetty API Doc - v10.0.7)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2021-10-11">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="IdentityService (Eclipse Jetty API Doc - v10.0.7)";
}
}
catch(err) {
}
//-->
var data = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/IdentityService.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" id="allclasses_navbar_top">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&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>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.eclipse.jetty.security</a></div>
<h2 title="Interface IdentityService" class="title">Interface IdentityService</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="DefaultIdentityService.html" title="class in org.eclipse.jetty.security">DefaultIdentityService</a></code></dd>
</dl>
<hr>
<pre>public interface <span class="typeNameLabel">IdentityService</span></pre>
<div class="block">Associates UserIdentities from with threads and UserIdentity.Contexts.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#NO_ROLES">NO_ROLES</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#associate(org.eclipse.jetty.server.UserIdentity)">associate</a></span>&#8203;(<a href="../server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a>&nbsp;user)</code></th>
<td class="colLast">
<div class="block">Associate a user identity with the current thread.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#disassociate(java.lang.Object)">disassociate</a></span>&#8203;(java.lang.Object&nbsp;previous)</code></th>
<td class="colLast">
<div class="block">Disassociate the user identity from the current thread
and restore previous identity.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSystemUserIdentity()">getSystemUserIdentity</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="RunAsToken.html" title="interface in org.eclipse.jetty.security">RunAsToken</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newRunAsToken(java.lang.String)">newRunAsToken</a></span>&#8203;(java.lang.String&nbsp;runAsName)</code></th>
<td class="colLast">
<div class="block">Create a new RunAsToken from a runAsName (normally a role).</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newUserIdentity(javax.security.auth.Subject,java.security.Principal,java.lang.String%5B%5D)">newUserIdentity</a></span>&#8203;(javax.security.auth.Subject&nbsp;subject,
java.security.Principal&nbsp;userPrincipal,
java.lang.String[]&nbsp;roles)</code></th>
<td class="colLast">
<div class="block">Create a new UserIdentity for use with this identity service.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setRunAs(org.eclipse.jetty.server.UserIdentity,org.eclipse.jetty.security.RunAsToken)">setRunAs</a></span>&#8203;(<a href="../server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a>&nbsp;user,
<a href="RunAsToken.html" title="interface in org.eclipse.jetty.security">RunAsToken</a>&nbsp;token)</code></th>
<td class="colLast">
<div class="block">Associate a runas Token with the current user and thread.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#unsetRunAs(java.lang.Object)">unsetRunAs</a></span>&#8203;(java.lang.Object&nbsp;token)</code></th>
<td class="colLast">
<div class="block">Disassociate the current runAsToken from the thread
and reassociate the previous token.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a id="NO_ROLES">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NO_ROLES</h4>
<pre>static final&nbsp;java.lang.String[] NO_ROLES</pre>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="associate(org.eclipse.jetty.server.UserIdentity)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>associate</h4>
<pre class="methodSignature">java.lang.Object&nbsp;associate&#8203;(<a href="../server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a>&nbsp;user)</pre>
<div class="block">Associate a user identity with the current thread.
This is called with as a thread enters the
<a href="SecurityHandler.html#handle(java.lang.String,org.eclipse.jetty.server.Request,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)"><code>SecurityHandler.handle(String, org.eclipse.jetty.server.Request, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)</code></a>
method and then again with a null argument as that call exits.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>user</code> - The current user or null for no user to associated.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an object representing the previous associated state</dd>
</dl>
</li>
</ul>
<a id="disassociate(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>disassociate</h4>
<pre class="methodSignature">void&nbsp;disassociate&#8203;(java.lang.Object&nbsp;previous)</pre>
<div class="block">Disassociate the user identity from the current thread
and restore previous identity.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>previous</code> - The opaque object returned from a call to <a href="#associate(org.eclipse.jetty.server.UserIdentity)"><code>associate(UserIdentity)</code></a></dd>
</dl>
</li>
</ul>
<a id="setRunAs(org.eclipse.jetty.server.UserIdentity,org.eclipse.jetty.security.RunAsToken)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRunAs</h4>
<pre class="methodSignature">java.lang.Object&nbsp;setRunAs&#8203;(<a href="../server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a>&nbsp;user,
<a href="RunAsToken.html" title="interface in org.eclipse.jetty.security">RunAsToken</a>&nbsp;token)</pre>
<div class="block">Associate a runas Token with the current user and thread.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>user</code> - The UserIdentity</dd>
<dd><code>token</code> - The runAsToken to associate.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The previous runAsToken or null.</dd>
</dl>
</li>
</ul>
<a id="unsetRunAs(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unsetRunAs</h4>
<pre class="methodSignature">void&nbsp;unsetRunAs&#8203;(java.lang.Object&nbsp;token)</pre>
<div class="block">Disassociate the current runAsToken from the thread
and reassociate the previous token.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>token</code> - RUNAS returned from previous associateRunAs call</dd>
</dl>
</li>
</ul>
<a id="newUserIdentity(javax.security.auth.Subject,java.security.Principal,java.lang.String[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newUserIdentity</h4>
<pre class="methodSignature"><a href="../server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a>&nbsp;newUserIdentity&#8203;(javax.security.auth.Subject&nbsp;subject,
java.security.Principal&nbsp;userPrincipal,
java.lang.String[]&nbsp;roles)</pre>
<div class="block">Create a new UserIdentity for use with this identity service.
The UserIdentity should be immutable and able to be cached.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>subject</code> - Subject to include in UserIdentity</dd>
<dd><code>userPrincipal</code> - Principal to include in UserIdentity. This will be returned from getUserPrincipal calls</dd>
<dd><code>roles</code> - set of roles to include in UserIdentity.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A new immutable UserIdententity</dd>
</dl>
</li>
</ul>
<a id="newRunAsToken(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newRunAsToken</h4>
<pre class="methodSignature"><a href="RunAsToken.html" title="interface in org.eclipse.jetty.security">RunAsToken</a>&nbsp;newRunAsToken&#8203;(java.lang.String&nbsp;runAsName)</pre>
<div class="block">Create a new RunAsToken from a runAsName (normally a role).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>runAsName</code> - Normally a role name</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A new immutable RunAsToken</dd>
</dl>
</li>
</ul>
<a id="getSystemUserIdentity()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getSystemUserIdentity</h4>
<pre class="methodSignature"><a href="../server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a>&nbsp;getSystemUserIdentity()</pre>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/IdentityService.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" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses.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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&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>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 1995&#x2013;2021 <a href="https://webtide.com">Webtide</a>. All rights reserved.</small></p>
</footer>
</body>
</html>