blob: 5d2bf6f64e5bde4bfacd1bbb2adce348a92c85a9 [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 (version 1.7.0_80) on Wed Jun 07 15:10:51 EDT 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IdentityService (Jetty :: Project 9.2.22.v20170606 API)</title>
<meta name="date" content="2017-06-07">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="IdentityService (Jetty :: Project 9.2.22.v20170606 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><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/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 class="aboutLanguage"><em><script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1149868-7']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/eclipse/jetty/security/HashLoginService.html" title="class in org.eclipse.jetty.security"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/eclipse/jetty/security/JDBCLoginService.html" title="class in org.eclipse.jetty.security"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/jetty/security/IdentityService.html" target="_top">Frames</a></li>
<li><a href="IdentityService.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All 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>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 name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.eclipse.jetty.security</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><a href="../../../../org/eclipse/jetty/security/DefaultIdentityService.html" title="class in org.eclipse.jetty.security">DefaultIdentityService</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="strong">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 =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" 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="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/jetty/security/IdentityService.html#NO_ROLES">NO_ROLES</a></strong></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/jetty/security/IdentityService.html#associate(org.eclipse.jetty.server.UserIdentity)">associate</a></strong>(<a href="../../../../org/eclipse/jetty/server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a>&nbsp;user)</code>
<div class="block">Associate a user identity with the current thread.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/jetty/security/IdentityService.html#disassociate(java.lang.Object)">disassociate</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;previous)</code>
<div class="block">Disassociate the user identity from the current thread
and restore previous identity.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/eclipse/jetty/server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/jetty/security/IdentityService.html#getSystemUserIdentity()">getSystemUserIdentity</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/eclipse/jetty/security/RunAsToken.html" title="interface in org.eclipse.jetty.security">RunAsToken</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/jetty/security/IdentityService.html#newRunAsToken(java.lang.String)">newRunAsToken</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;runAsName)</code>
<div class="block">Create a new RunAsToken from a runAsName (normally a role).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/eclipse/jetty/server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/jetty/security/IdentityService.html#newUserIdentity(javax.security.auth.Subject,%20java.security.Principal,%20java.lang.String[])">newUserIdentity</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/javax/security/auth/Subject.html?is-external=true" title="class or interface in javax.security.auth">Subject</a>&nbsp;subject,
<a href="http://docs.oracle.com/javase/7/docs/api/java/security/Principal.html?is-external=true" title="class or interface in java.security">Principal</a>&nbsp;userPrincipal,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;roles)</code>
<div class="block">Create a new UserIdentity for use with this identity service.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/jetty/security/IdentityService.html#setRunAs(org.eclipse.jetty.server.UserIdentity,%20org.eclipse.jetty.security.RunAsToken)">setRunAs</a></strong>(<a href="../../../../org/eclipse/jetty/server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a>&nbsp;user,
<a href="../../../../org/eclipse/jetty/security/RunAsToken.html" title="interface in org.eclipse.jetty.security">RunAsToken</a>&nbsp;token)</code>
<div class="block">Associate a runas Token with the current user and thread.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/jetty/security/IdentityService.html#unsetRunAs(java.lang.Object)">unsetRunAs</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;token)</code>
<div class="block">Disassociate the current runAsToken from the thread
and reassociate the previous token.</div>
</td>
</tr>
</table>
</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="NO_ROLES">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NO_ROLES</h4>
<pre>static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] NO_ROLES</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="associate(org.eclipse.jetty.server.UserIdentity)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>associate</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;associate(<a href="../../../../org/eclipse/jetty/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="../../../../org/eclipse/jetty/security/SecurityHandler.html#handle(java.lang.String,%20org.eclipse.jetty.server.Request,%20javax.servlet.http.HttpServletRequest,%20javax.servlet.http.HttpServletResponse)"><code>SecurityHandler.handle(String, 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="strong">Parameters:</span></dt><dd><code>user</code> - The current user or null for no user to associated.</dd>
<dt><span class="strong">Returns:</span></dt><dd>an object representing the previous associated state</dd></dl>
</li>
</ul>
<a name="disassociate(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>disassociate</h4>
<pre>void&nbsp;disassociate(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;previous)</pre>
<div class="block">Disassociate the user identity from the current thread
and restore previous identity.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>previous</code> - The opaque object returned from a call to <a href="../../../../org/eclipse/jetty/security/IdentityService.html#associate(org.eclipse.jetty.server.UserIdentity)"><code>associate(UserIdentity)</code></a></dd></dl>
</li>
</ul>
<a name="setRunAs(org.eclipse.jetty.server.UserIdentity, org.eclipse.jetty.security.RunAsToken)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRunAs</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;setRunAs(<a href="../../../../org/eclipse/jetty/server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a>&nbsp;user,
<a href="../../../../org/eclipse/jetty/security/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="strong">Parameters:</span></dt><dd><code>user</code> - The UserIdentity</dd><dd><code>token</code> - The runAsToken to associate.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The previous runAsToken or null.</dd></dl>
</li>
</ul>
<a name="unsetRunAs(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unsetRunAs</h4>
<pre>void&nbsp;unsetRunAs(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;token)</pre>
<div class="block">Disassociate the current runAsToken from the thread
and reassociate the previous token.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>token</code> - RUNAS returned from previous associateRunAs call</dd></dl>
</li>
</ul>
<a name="newUserIdentity(javax.security.auth.Subject, java.security.Principal, java.lang.String[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newUserIdentity</h4>
<pre><a href="../../../../org/eclipse/jetty/server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a>&nbsp;newUserIdentity(<a href="http://docs.oracle.com/javase/7/docs/api/javax/security/auth/Subject.html?is-external=true" title="class or interface in javax.security.auth">Subject</a>&nbsp;subject,
<a href="http://docs.oracle.com/javase/7/docs/api/java/security/Principal.html?is-external=true" title="class or interface in java.security">Principal</a>&nbsp;userPrincipal,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&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="strong">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="strong">Returns:</span></dt><dd>A new immutable UserIdententity</dd></dl>
</li>
</ul>
<a name="newRunAsToken(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newRunAsToken</h4>
<pre><a href="../../../../org/eclipse/jetty/security/RunAsToken.html" title="interface in org.eclipse.jetty.security">RunAsToken</a>&nbsp;newRunAsToken(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;runAsName)</pre>
<div class="block">Create a new RunAsToken from a runAsName (normally a role).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>runAsName</code> - Normally a role name</dd>
<dt><span class="strong">Returns:</span></dt><dd>A new immutable RunAsToken</dd></dl>
</li>
</ul>
<a name="getSystemUserIdentity()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getSystemUserIdentity</h4>
<pre><a href="../../../../org/eclipse/jetty/server/UserIdentity.html" title="interface in org.eclipse.jetty.server">UserIdentity</a>&nbsp;getSystemUserIdentity()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><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/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 class="aboutLanguage"><em><script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1149868-7']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/eclipse/jetty/security/HashLoginService.html" title="class in org.eclipse.jetty.security"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/eclipse/jetty/security/JDBCLoginService.html" title="class in org.eclipse.jetty.security"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/jetty/security/IdentityService.html" target="_top">Frames</a></li>
<li><a href="IdentityService.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All 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>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 name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 1995-2017 <a href="http://webtide.com">Webtide</a>. All Rights Reserved.</small></p>
</body>
</html>