blob: 188a31598869efcc7d725bc02740528148c125b1 [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>
<title>IdentityStore</title>
<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="IdentityStore";
}
}
catch(err) {
}
//-->
var methods = {"i0":18,"i1":18,"i2":18,"i3":18};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],16:["t5","Default 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="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><a href="../../../../javax/security/enterprise/identitystore/DatabaseIdentityStoreDefinition.html" title="annotation in javax.security.enterprise.identitystore"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../javax/security/enterprise/identitystore/IdentityStore.ValidationType.html" title="enum in javax.security.enterprise.identitystore"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?javax/security/enterprise/identitystore/IdentityStore.html" target="_top">Frames</a></li>
<li><a href="IdentityStore.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>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">javax.security.enterprise.identitystore</div>
<h2 title="Interface IdentityStore" class="title">Interface IdentityStore</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../javax/security/enterprise/identitystore/IdentityStoreWrapper.html" title="class in javax.security.enterprise.identitystore">IdentityStoreWrapper</a>, <a href="../../../../org/apache/tomee/security/identitystore/TomEEDefaultIdentityStore.html" title="class in org.apache.tomee.security.identitystore">TomEEDefaultIdentityStore</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">IdentityStore</span></pre>
<div class="block"><code>IdentityStore</code> is a mechanism for validating a caller's credentials
and accessing a caller's identity attributes. It can be used by an
authentication mechanism, such as a JSR 375 <a href="../../../../javax/security/enterprise/authentication/mechanism/http/HttpAuthenticationMechanism.html" title="interface in javax.security.enterprise.authentication.mechanism.http"><code>HttpAuthenticationMechanism</code></a>
or a JSR 196 (JASPIC) <code>ServerAuthModule</code>.
<p>
Stores which do only validation or only group lookup are allowed.
<p>
An <code>IdentityStore</code> obtains identity data from a persistent store,
such as a database, LDAP server, or file.</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">Interface 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="../../../../javax/security/enterprise/identitystore/IdentityStore.ValidationType.html" title="enum in javax.security.enterprise.identitystore">IdentityStore.ValidationType</a></span></code>
<div class="block">Determines the type of validation (operations) that should be done by this store.</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 java.util.Set&lt;<a href="../../../../javax/security/enterprise/identitystore/IdentityStore.ValidationType.html" title="enum in javax.security.enterprise.identitystore">IdentityStore.ValidationType</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html#DEFAULT_VALIDATION_TYPES">DEFAULT_VALIDATION_TYPES</a></span></code>
<div class="block">Default set of validation types.</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="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default 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>default java.util.Set&lt;java.lang.String&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html#getCallerGroups-javax.security.enterprise.identitystore.CredentialValidationResult-">getCallerGroups</a></span>(<a href="../../../../javax/security/enterprise/identitystore/CredentialValidationResult.html" title="class in javax.security.enterprise.identitystore">CredentialValidationResult</a>&nbsp;validationResult)</code>
<div class="block">Returns groups for the caller, who is identified by the <a href="../../../../javax/security/enterprise/CallerPrincipal.html" title="class in javax.security.enterprise"><code>CallerPrincipal</code></a>
(and potentially other values) found in the <code>validationResult</code> parameter.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>default int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html#priority--">priority</a></span>()</code>
<div class="block">Determines the order of invocation for multiple <a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html" title="interface in javax.security.enterprise.identitystore"><code>IdentityStore</code></a>s.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>default <a href="../../../../javax/security/enterprise/identitystore/CredentialValidationResult.html" title="class in javax.security.enterprise.identitystore">CredentialValidationResult</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html#validate-javax.security.enterprise.credential.Credential-">validate</a></span>(<a href="../../../../javax/security/enterprise/credential/Credential.html" title="interface in javax.security.enterprise.credential">Credential</a>&nbsp;credential)</code>
<div class="block">Validates the given credential.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>default java.util.Set&lt;<a href="../../../../javax/security/enterprise/identitystore/IdentityStore.ValidationType.html" title="enum in javax.security.enterprise.identitystore">IdentityStore.ValidationType</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html#validationTypes--">validationTypes</a></span>()</code>
<div class="block">Determines the type of validation the <a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html" title="interface in javax.security.enterprise.identitystore"><code>IdentityStore</code></a> should be used for.</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="DEFAULT_VALIDATION_TYPES">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DEFAULT_VALIDATION_TYPES</h4>
<pre>static final&nbsp;java.util.Set&lt;<a href="../../../../javax/security/enterprise/identitystore/IdentityStore.ValidationType.html" title="enum in javax.security.enterprise.identitystore">IdentityStore.ValidationType</a>&gt; DEFAULT_VALIDATION_TYPES</pre>
<div class="block">Default set of validation types. Contains <code>VALIDATE</code> and <code>PROVIDE_GROUPS</code>.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="validate-javax.security.enterprise.credential.Credential-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>validate</h4>
<pre>default&nbsp;<a href="../../../../javax/security/enterprise/identitystore/CredentialValidationResult.html" title="class in javax.security.enterprise.identitystore">CredentialValidationResult</a>&nbsp;validate(<a href="../../../../javax/security/enterprise/credential/Credential.html" title="interface in javax.security.enterprise.credential">Credential</a>&nbsp;credential)</pre>
<div class="block">Validates the given credential.
<p>
As a convenience, a default implementation is provided that looks up an overload of this method
that has, as its one and only parameter, a subclass of <a href="../../../../javax/security/enterprise/credential/Credential.html" title="interface in javax.security.enterprise.credential"><code>Credential</code></a>. Here is an example of what
an implementation of this interface looks like with such an overloaded method:
<blockquote><pre><code>
public class ExampleIdentityStore implements IdentityStore {
public CredentialValidationResult validate(UsernamePasswordCredential usernamePasswordCredential) {
// Implementation ...
return INVALID_RESULT;
}
}
</code></pre></blockquote>
<p>
Note that the overloaded method is only called when the actual type passed into this method will <i>exactly</i> match
the parameter type of the overloaded method. There's no attempt being done to find the most specific overloaded method
such as specified in JLS 15.2.
<p>
This method returns a <a href="../../../../javax/security/enterprise/identitystore/CredentialValidationResult.html" title="class in javax.security.enterprise.identitystore"><code>CredentialValidationResult</code></a> representing the result of the validation attempt:
whether it succeeded or failed, and, for a successful validation, the <a href="../../../../javax/security/enterprise/CallerPrincipal.html" title="class in javax.security.enterprise"><code>CallerPrincipal</code></a>, and possibly
groups or other attributes, of the caller.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>credential</code> - The credential to validate.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The validation result.</dd>
</dl>
</li>
</ul>
<a name="getCallerGroups-javax.security.enterprise.identitystore.CredentialValidationResult-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCallerGroups</h4>
<pre>default&nbsp;java.util.Set&lt;java.lang.String&gt;&nbsp;getCallerGroups(<a href="../../../../javax/security/enterprise/identitystore/CredentialValidationResult.html" title="class in javax.security.enterprise.identitystore">CredentialValidationResult</a>&nbsp;validationResult)</pre>
<div class="block">Returns groups for the caller, who is identified by the <a href="../../../../javax/security/enterprise/CallerPrincipal.html" title="class in javax.security.enterprise"><code>CallerPrincipal</code></a>
(and potentially other values) found in the <code>validationResult</code> parameter.
<p>
Callers (i.e., <a href="../../../../javax/security/enterprise/identitystore/IdentityStoreHandler.html" title="interface in javax.security.enterprise.identitystore"><code>IdentityStoreHandler</code></a>s) should have
<a href="../../../../javax/security/enterprise/identitystore/IdentityStorePermission.html" title="class in javax.security.enterprise.identitystore"><code>IdentityStorePermission</code></a> permission to invoke this method.
Implementations should check for this permission before doing any work:
<blockquote><pre><code>
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkPermission(new IdentityStorePermission("getGroups");
}
</code></pre></blockquote></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>validationResult</code> - The <a href="../../../../javax/security/enterprise/identitystore/CredentialValidationResult.html" title="class in javax.security.enterprise.identitystore"><code>CredentialValidationResult</code></a> returned
by a previous call to <a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html#validate-javax.security.enterprise.credential.Credential-"><code>validate(Credential)</code></a>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The <code>Set</code> of groups found for the caller, if any, or an empty <code>Set</code> otherwise.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.SecurityException</code> - May be thrown if the calling code does not have <a href="../../../../javax/security/enterprise/identitystore/IdentityStorePermission.html" title="class in javax.security.enterprise.identitystore"><code>IdentityStorePermission</code></a>.</dd>
</dl>
</li>
</ul>
<a name="priority--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>priority</h4>
<pre>default&nbsp;int&nbsp;priority()</pre>
<div class="block">Determines the order of invocation for multiple <a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html" title="interface in javax.security.enterprise.identitystore"><code>IdentityStore</code></a>s.
Stores with a lower priority value are consulted first.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The priority value. Lower values indicate higher priorities.</dd>
</dl>
</li>
</ul>
<a name="validationTypes--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>validationTypes</h4>
<pre>default&nbsp;java.util.Set&lt;<a href="../../../../javax/security/enterprise/identitystore/IdentityStore.ValidationType.html" title="enum in javax.security.enterprise.identitystore">IdentityStore.ValidationType</a>&gt;&nbsp;validationTypes()</pre>
<div class="block">Determines the type of validation the <a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html" title="interface in javax.security.enterprise.identitystore"><code>IdentityStore</code></a> should be used for.
By default, its used for credential validation AND providing groups.
<p>
Implementations of this API should not return a direct reference
to a <code>Set</code> used internally to represent an <a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html" title="interface in javax.security.enterprise.identitystore"><code>IdentityStore</code></a>'s validation types,
unless it is an immutable <code>Set</code>. Callers of the API should be aware that
the returned <code>Set</code> may be immutable, or a copy, and that, in any case,
it should not be modified by the caller.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>Set</code> containing the validation types enabled for the <a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html" title="interface in javax.security.enterprise.identitystore"><code>IdentityStore</code></a>.</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="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><a href="../../../../javax/security/enterprise/identitystore/DatabaseIdentityStoreDefinition.html" title="annotation in javax.security.enterprise.identitystore"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../javax/security/enterprise/identitystore/IdentityStore.ValidationType.html" title="enum in javax.security.enterprise.identitystore"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?javax/security/enterprise/identitystore/IdentityStore.html" target="_top">Frames</a></li>
<li><a href="IdentityStore.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>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 ======= -->
</body>
</html>