blob: 12a2b33efde70cb88f7919f83593fed79538a79e [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="fr">
<head>
<!-- Generated by javadoc (1.8.0_201) on Wed May 01 07:16:44 RET 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>AuthenticatingRealm (Apache Shiro 1.4.1 API)</title>
<meta name="date" content="2019-05-01">
<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="AuthenticatingRealm (Apache Shiro 1.4.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":6,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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/AuthenticatingRealm.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/shiro/realm/AuthorizingRealm.html" title="class in org.apache.shiro.realm"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/shiro/realm/AuthenticatingRealm.html" target="_top">Frames</a></li>
<li><a href="AuthenticatingRealm.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>Nested&nbsp;|&nbsp;</li>
<li>Field&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>Field&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.shiro.realm</div>
<h2 title="Class AuthenticatingRealm" class="title">Class AuthenticatingRealm</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/6/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><a href="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">org.apache.shiro.realm.CachingRealm</a></li>
<li>
<ul class="inheritance">
<li>org.apache.shiro.realm.AuthenticatingRealm</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../org/apache/shiro/authc/LogoutAware.html" title="interface in org.apache.shiro.authc">LogoutAware</a>, <a href="../../../../org/apache/shiro/cache/CacheManagerAware.html" title="interface in org.apache.shiro.cache">CacheManagerAware</a>, <a href="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>, <a href="../../../../org/apache/shiro/util/Initializable.html" title="interface in org.apache.shiro.util">Initializable</a>, <a href="../../../../org/apache/shiro/util/Nameable.html" title="interface in org.apache.shiro.util">Nameable</a></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../org/apache/shiro/realm/AuthorizingRealm.html" title="class in org.apache.shiro.realm">AuthorizingRealm</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.113">AuthenticatingRealm</a>
extends <a href="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</a>
implements <a href="../../../../org/apache/shiro/util/Initializable.html" title="interface in org.apache.shiro.util">Initializable</a></pre>
<div class="block">A top-level abstract implementation of the <tt>Realm</tt> interface that only implements authentication support
(log-in) operations and leaves authorization (access control) behavior to subclasses.
<h2>Authentication Caching</h2>
For applications that perform frequent repeated authentication of the same accounts (e.g. as is often done in
REST or Soap applications that authenticate on every request), it might be prudent to enable authentication
caching to alleviate constant load on any back-end data sources.
<p/>
This feature is disabled by default to retain backwards-compatibility with Shiro 1.1 and earlier. It may be
enabled by setting <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCachingEnabled-boolean-"><code>authenticationCachingEnabled</code></a> = <code>true</code>
(and configuring Shiro with a <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> of course), but <b>NOTE:</b>
<p/>
<b>ONLY enable authentication caching if either of the following is true for your realm implementation:</b>
<ul>
<li>The <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#doGetAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-"><code>doGetAuthenticationInfo</code></a>
implementation returns <code>AuthenticationInfo</code> instances where the
<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html#getCredentials--"><code>credentials</code></a> are securely obfuscated and NOT
plaintext (raw) credentials. For example,
if your realm references accounts with passwords, that the <code>AuthenticationInfo</code>'s
<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html#getCredentials--"><code>credentials</code></a> are safely hashed and salted or otherwise
fully encrypted.<br/><br/></li>
<li>The <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#doGetAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-"><code>doGetAuthenticationInfo</code></a>
implementation returns <code>AuthenticationInfo</code> instances where the
<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html#getCredentials--"><code>credentials</code></a> are plaintext (raw) <b>AND</b> the
cache region storing the <code>AuthenticationInfo</code> instances WILL NOT overflow to disk and WILL NOT transmit cache
entries over an unprotected (non TLS/SSL) network (as might be the case with a networked/distributed enterprise cache).
This should be the case even in private/trusted/corporate networks.</li>
</ul>
<p/>
These points are very important because if authentication caching is enabled, this abstract class implementation
will place AuthenticationInfo instances returned from the subclass implementations directly into the cache, for
example:
<pre>
cache.put(cacheKey, subclassAuthenticationInfoInstance);
</pre>
<p/>
Enabling authentication caching is ONLY safe to do if the above two scenarios apply. It is NOT safe to enable under
any other scenario.
<p/>
When possible, always represent and store credentials in a safe form (hash+salt or encrypted) to eliminate plaintext
visibility.
<h3>Authentication Cache Invalidation on Logout</h3>
If authentication caching is enabled, this implementation will attempt to evict (remove) cached authentication data
for an account during logout. This can only occur if the
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey-org.apache.shiro.authc.AuthenticationToken-"><code>getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)</code></a> and
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey-org.apache.shiro.subject.PrincipalCollection-"><code>getAuthenticationCacheKey(org.apache.shiro.subject.PrincipalCollection)</code></a> methods return the exact same value.
<p/>
The default implementations of these methods expect that the
<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html#getPrincipal--"><code>AuthenticationToken.getPrincipal()</code></a> (what the user submits during login) and
<a href="../../../../org/apache/shiro/realm/CachingRealm.html#getAvailablePrincipal-org.apache.shiro.subject.PrincipalCollection-"><code>getAvailablePrincipal</code></a> (what is returned
by the realm after account lookup) return
the same exact value. For example, the user submitted username is also the primary account identifier.
<p/>
However, if your application uses, say, a username for end-user login, but returns a primary key ID as the
primary principal after authentication, then you will need to override either
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey-org.apache.shiro.authc.AuthenticationToken-"><code>getAuthenticationCacheKey(token)</code></a> or
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey-org.apache.shiro.subject.PrincipalCollection-"><code>getAuthenticationCacheKey(principals)</code></a>
(or both) to ensure that the same cache key can be used for either object.
<p/>
This guarantees that the same cache key used to cache the data during authentication (derived from the
<code>AuthenticationToken</code>) will be used to remove the cached data during logout (derived from the
<code>PrincipalCollection</code>).
<h4>Unmatching Cache Key Values</h4>
If the return values from <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey-org.apache.shiro.authc.AuthenticationToken-"><code>getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)</code></a> and
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey-org.apache.shiro.subject.PrincipalCollection-"><code>getAuthenticationCacheKey(org.apache.shiro.subject.PrincipalCollection)</code></a> are not identical, cached
authentication data removal is at the mercy of your cache provider settings. For example, often cache
implementations will evict cache entries based on a timeToIdle or timeToLive (TTL) value.
<p/>
If this lazy eviction capability of the cache product is not sufficient and you want discrete behavior
(highly recommended for authentication data), ensure that the return values from those two methods are identical in
the subclass implementation.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>0.2</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== 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/shiro/realm/AuthenticatingRealm.html#AuthenticatingRealm--">AuthenticatingRealm</a></span>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#AuthenticatingRealm-org.apache.shiro.cache.CacheManager-">AuthenticatingRealm</a></span>(<a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache">CacheManager</a>&nbsp;cacheManager)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#AuthenticatingRealm-org.apache.shiro.cache.CacheManager-org.apache.shiro.authc.credential.CredentialsMatcher-">AuthenticatingRealm</a></span>(<a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache">CacheManager</a>&nbsp;cacheManager,
<a href="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a>&nbsp;matcher)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#AuthenticatingRealm-org.apache.shiro.authc.credential.CredentialsMatcher-">AuthenticatingRealm</a></span>(<a href="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a>&nbsp;matcher)</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="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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract 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>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#afterCacheManagerSet--">afterCacheManagerSet</a></span>()</code>
<div class="block">This implementation attempts to acquire an authentication cache if one is not already configured.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#assertCredentialsMatch-org.apache.shiro.authc.AuthenticationToken-org.apache.shiro.authc.AuthenticationInfo-">assertCredentialsMatch</a></span>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token,
<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;info)</code>
<div class="block">Asserts that the submitted <code>AuthenticationToken</code>'s credentials match the stored account
<code>AuthenticationInfo</code>'s credentials, and if not, throws an <a href="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc"><code>AuthenticationException</code></a>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#clearCachedAuthenticationInfo-org.apache.shiro.subject.PrincipalCollection-">clearCachedAuthenticationInfo</a></span>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a>&nbsp;principals)</code>
<div class="block">Clears out the AuthenticationInfo cache entry for the specified account.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#doClearCache-org.apache.shiro.subject.PrincipalCollection-">doClearCache</a></span>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a>&nbsp;principals)</code>
<div class="block">This implementation clears out any cached authentication data by calling
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#clearCachedAuthenticationInfo-org.apache.shiro.subject.PrincipalCollection-"><code>clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection)</code></a>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>protected abstract <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#doGetAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-">doGetAuthenticationInfo</a></span>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token)</code>
<div class="block">Retrieves authentication data from an implementation-specific datasource (RDBMS, LDAP, etc) for the given
authentication token.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache">Cache</a>&lt;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>,<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCache--">getAuthenticationCache</a></span>()</code>
<div class="block">Returns a <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> instance to use for authentication caching, or <code>null</code> if no cache has been
set.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey-org.apache.shiro.authc.AuthenticationToken-">getAuthenticationCacheKey</a></span>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token)</code>
<div class="block">Returns the key under which <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> instances are cached if authentication caching is enabled.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey-org.apache.shiro.subject.PrincipalCollection-">getAuthenticationCacheKey</a></span>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a>&nbsp;principals)</code>
<div class="block">Returns the key under which <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> instances are cached if authentication caching is enabled.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/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/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheName--">getAuthenticationCacheName</a></span>()</code>
<div class="block">Returns the name of a <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> to lookup from any available <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getCacheManager--"><code>cacheManager</code></a> if
a cache is not explicitly configured via <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache-org.apache.shiro.cache.Cache-"><code>setAuthenticationCache(org.apache.shiro.cache.Cache)</code></a>.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-">getAuthenticationInfo</a></span>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token)</code>
<div class="block">This implementation functions as follows:
It attempts to acquire any cached <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> corresponding to the specified
<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc"><code>AuthenticationToken</code></a> argument.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationTokenClass--">getAuthenticationTokenClass</a></span>()</code>
<div class="block">Returns the authenticationToken class supported by this realm.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getCredentialsMatcher--">getCredentialsMatcher</a></span>()</code>
<div class="block">Returns the <code>CredentialsMatcher</code> used during an authentication attempt to verify submitted
credentials with those stored in the system.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#init--">init</a></span>()</code>
<div class="block">Initializes this realm and potentially enables an authentication cache, depending on configuration.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled--">isAuthenticationCachingEnabled</a></span>()</code>
<div class="block">Returns <code>true</code> if authentication caching should be utilized if a <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> has been
<a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager-org.apache.shiro.cache.CacheManager-"><code>configured</code></a>, <code>false</code> otherwise.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled-org.apache.shiro.authc.AuthenticationToken-org.apache.shiro.authc.AuthenticationInfo-">isAuthenticationCachingEnabled</a></span>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token,
<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;info)</code>
<div class="block">Returns <code>true</code> if authentication caching should be utilized based on the specified
<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc"><code>AuthenticationToken</code></a> and/or <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a>, <code>false</code> otherwise.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#onInit--">onInit</a></span>()</code>
<div class="block">Template method for subclasses to implement any initialization logic.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache-org.apache.shiro.cache.Cache-">setAuthenticationCache</a></span>(<a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache">Cache</a>&lt;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>,<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&gt;&nbsp;authenticationCache)</code>
<div class="block">Sets an explicit <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> instance to use for authentication caching.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCacheName-java.lang.String-">setAuthenticationCacheName</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;authenticationCacheName)</code>
<div class="block">Sets the name of a <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> to lookup from any available <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getCacheManager--"><code>cacheManager</code></a> if
a cache is not explicitly configured via <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache-org.apache.shiro.cache.Cache-"><code>setAuthenticationCache(org.apache.shiro.cache.Cache)</code></a>.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCachingEnabled-boolean-">setAuthenticationCachingEnabled</a></span>(boolean&nbsp;authenticationCachingEnabled)</code>
<div class="block">Sets whether or not authentication caching should be utilized if a <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> has been
<a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager-org.apache.shiro.cache.CacheManager-"><code>configured</code></a>, <code>false</code> otherwise.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationTokenClass-java.lang.Class-">setAuthenticationTokenClass</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&gt;&nbsp;authenticationTokenClass)</code>
<div class="block">Sets the authenticationToken class supported by this realm.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setCredentialsMatcher-org.apache.shiro.authc.credential.CredentialsMatcher-">setCredentialsMatcher</a></span>(<a href="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a>&nbsp;credentialsMatcher)</code>
<div class="block">Sets the CrendialsMatcher used during an authentication attempt to verify submitted credentials with those
stored in the system.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setName-java.lang.String-">setName</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code>
<div class="block">Sets the (preferably application unique) name for this component.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#supports-org.apache.shiro.authc.AuthenticationToken-">supports</a></span>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token)</code>
<div class="block">Convenience implementation that returns
<tt>getAuthenticationTokenClass().isAssignableFrom( token.getClass() );</tt>.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.shiro.realm.CachingRealm">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.shiro.realm.<a href="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</a></h3>
<code><a href="../../../../org/apache/shiro/realm/CachingRealm.html#clearCache-org.apache.shiro.subject.PrincipalCollection-">clearCache</a>, <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getAvailablePrincipal-org.apache.shiro.subject.PrincipalCollection-">getAvailablePrincipal</a>, <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getCacheManager--">getCacheManager</a>, <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getName--">getName</a>, <a href="../../../../org/apache/shiro/realm/CachingRealm.html#isCachingEnabled--">isCachingEnabled</a>, <a href="../../../../org/apache/shiro/realm/CachingRealm.html#onLogout-org.apache.shiro.subject.PrincipalCollection-">onLogout</a>, <a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager-org.apache.shiro.cache.CacheManager-">setCacheManager</a>, <a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCachingEnabled-boolean-">setCachingEnabled</a></code></li>
</ul>
<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="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/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">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="AuthenticatingRealm--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>AuthenticatingRealm</h4>
<pre>public&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.149">AuthenticatingRealm</a>()</pre>
</li>
</ul>
<a name="AuthenticatingRealm-org.apache.shiro.cache.CacheManager-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>AuthenticatingRealm</h4>
<pre>public&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.153">AuthenticatingRealm</a>(<a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache">CacheManager</a>&nbsp;cacheManager)</pre>
</li>
</ul>
<a name="AuthenticatingRealm-org.apache.shiro.authc.credential.CredentialsMatcher-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>AuthenticatingRealm</h4>
<pre>public&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.157">AuthenticatingRealm</a>(<a href="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a>&nbsp;matcher)</pre>
</li>
</ul>
<a name="AuthenticatingRealm-org.apache.shiro.cache.CacheManager-org.apache.shiro.authc.credential.CredentialsMatcher-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>AuthenticatingRealm</h4>
<pre>public&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.161">AuthenticatingRealm</a>(<a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache">CacheManager</a>&nbsp;cacheManager,
<a href="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a>&nbsp;matcher)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getCredentialsMatcher--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCredentialsMatcher</h4>
<pre>public&nbsp;<a href="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.196">getCredentialsMatcher</a>()</pre>
<div class="block">Returns the <code>CredentialsMatcher</code> used during an authentication attempt to verify submitted
credentials with those stored in the system.
<p/>
<p>Unless overridden by the <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setCredentialsMatcher-org.apache.shiro.authc.credential.CredentialsMatcher-"><code>setCredentialsMatcher</code></a> method, the default
value is a <a href="../../../../org/apache/shiro/authc/credential/SimpleCredentialsMatcher.html" title="class in org.apache.shiro.authc.credential"><code>SimpleCredentialsMatcher</code></a> instance.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <code>CredentialsMatcher</code> used during an authentication attempt to verify submitted
credentials with those stored in the system.</dd>
</dl>
</li>
</ul>
<a name="setCredentialsMatcher-org.apache.shiro.authc.credential.CredentialsMatcher-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCredentialsMatcher</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.210">setCredentialsMatcher</a>(<a href="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a>&nbsp;credentialsMatcher)</pre>
<div class="block">Sets the CrendialsMatcher used during an authentication attempt to verify submitted credentials with those
stored in the system. The implementation of this matcher can be switched via configuration to
support any number of schemes, including plain text comparisons, hashing comparisons, and others.
<p/>
<p>Unless overridden by this method, the default value is a
<a href="../../../../org/apache/shiro/authc/credential/SimpleCredentialsMatcher.html" title="class in org.apache.shiro.authc.credential"><code>SimpleCredentialsMatcher</code></a> instance.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>credentialsMatcher</code> - the matcher to use.</dd>
</dl>
</li>
</ul>
<a name="getAuthenticationTokenClass--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAuthenticationTokenClass</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.228">getAuthenticationTokenClass</a>()</pre>
<div class="block">Returns the authenticationToken class supported by this realm.
<p/>
<p>The default value is <tt><a href="../../../../org/apache/shiro/authc/UsernamePasswordToken.html" title="class in org.apache.shiro.authc"><code>UsernamePasswordToken.class</code></a></tt>, since
about 90% of realms use username/password authentication, regardless of their protocol (e.g. over jdbc, ldap,
kerberos, http, etc).
<p/>
<p>If subclasses haven't already overridden the <a href="../../../../org/apache/shiro/realm/Realm.html#supports-org.apache.shiro.authc.AuthenticationToken-"><code>Realm.supports(AuthenticationToken)</code></a> method,
they must <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationTokenClass-java.lang.Class-"><code>set a new class</code></a> if they won't support
<tt>UsernamePasswordToken</tt> authentication token submissions.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the authenticationToken class supported by this realm.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationTokenClass-java.lang.Class-"><code>setAuthenticationTokenClass(java.lang.Class&lt;? extends org.apache.shiro.authc.AuthenticationToken&gt;)</code></a></dd>
</dl>
</li>
</ul>
<a name="setAuthenticationTokenClass-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAuthenticationTokenClass</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.241">setAuthenticationTokenClass</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&gt;&nbsp;authenticationTokenClass)</pre>
<div class="block">Sets the authenticationToken class supported by this realm.
<p/>
<p>Unless overridden by this method, the default value is
<a href="../../../../org/apache/shiro/authc/UsernamePasswordToken.html" title="class in org.apache.shiro.authc"><code>UsernamePasswordToken.class</code></a> to support the majority of applications.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>authenticationTokenClass</code> - the class of authentication token instances supported by this realm.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationTokenClass--"><code>getAuthenticationTokenClass() for more explanation.</code></a></dd>
</dl>
</li>
</ul>
<a name="setAuthenticationCache-org.apache.shiro.cache.Cache-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAuthenticationCache</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.258">setAuthenticationCache</a>(<a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache">Cache</a>&lt;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>,<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&gt;&nbsp;authenticationCache)</pre>
<div class="block">Sets an explicit <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> instance to use for authentication caching. If not set and authentication
caching is <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled--"><code>enabled</code></a>, any available
<a href="../../../../org/apache/shiro/realm/CachingRealm.html#getCacheManager--"><code>cacheManager</code></a> will be used to acquire the cache instance if available.
<p/>
<b>WARNING:</b> Only set this property if safe caching conditions apply, as documented at the top
of this page in the class-level JavaDoc.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>authenticationCache</code> - an explicit <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> instance to use for authentication caching or
<code>null</code> if the cache should possibly be obtained another way.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled--"><code>isAuthenticationCachingEnabled()</code></a></dd>
</dl>
</li>
</ul>
<a name="getAuthenticationCache--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAuthenticationCache</h4>
<pre>public&nbsp;<a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache">Cache</a>&lt;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>,<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&gt;&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.272">getAuthenticationCache</a>()</pre>
<div class="block">Returns a <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> instance to use for authentication caching, or <code>null</code> if no cache has been
set.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> instance to use for authentication caching, or <code>null</code> if no cache has been
set.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache-org.apache.shiro.cache.Cache-"><code>setAuthenticationCache(org.apache.shiro.cache.Cache)</code></a>,
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled--"><code>isAuthenticationCachingEnabled()</code></a></dd>
</dl>
</li>
</ul>
<a name="getAuthenticationCacheName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAuthenticationCacheName</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.291">getAuthenticationCacheName</a>()</pre>
<div class="block">Returns the name of a <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> to lookup from any available <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getCacheManager--"><code>cacheManager</code></a> if
a cache is not explicitly configured via <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache-org.apache.shiro.cache.Cache-"><code>setAuthenticationCache(org.apache.shiro.cache.Cache)</code></a>.
<p/>
This name will only be used to look up a cache if authentication caching is
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled--"><code>enabled</code></a>.
<p/>
<b>WARNING:</b> Only set this property if safe caching conditions apply, as documented at the top
of this page in the class-level JavaDoc.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the name of a <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> to lookup from any available <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getCacheManager--"><code>cacheManager</code></a> if
a cache is not explicitly configured via <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache-org.apache.shiro.cache.Cache-"><code>setAuthenticationCache(org.apache.shiro.cache.Cache)</code></a>.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled--"><code>isAuthenticationCachingEnabled()</code></a></dd>
</dl>
</li>
</ul>
<a name="setAuthenticationCacheName-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAuthenticationCacheName</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.308">setAuthenticationCacheName</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;authenticationCacheName)</pre>
<div class="block">Sets the name of a <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> to lookup from any available <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getCacheManager--"><code>cacheManager</code></a> if
a cache is not explicitly configured via <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache-org.apache.shiro.cache.Cache-"><code>setAuthenticationCache(org.apache.shiro.cache.Cache)</code></a>.
<p/>
This name will only be used to look up a cache if authentication caching is
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled--"><code>enabled</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>authenticationCacheName</code> - the name of a <a href="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache"><code>Cache</code></a> to lookup from any available
<a href="../../../../org/apache/shiro/realm/CachingRealm.html#getCacheManager--"><code>cacheManager</code></a> if a cache is not explicitly configured
via <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache-org.apache.shiro.cache.Cache-"><code>setAuthenticationCache(org.apache.shiro.cache.Cache)</code></a>.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled--"><code>isAuthenticationCachingEnabled()</code></a></dd>
</dl>
</li>
</ul>
<a name="isAuthenticationCachingEnabled--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAuthenticationCachingEnabled</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.320">isAuthenticationCachingEnabled</a>()</pre>
<div class="block">Returns <code>true</code> if authentication caching should be utilized if a <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> has been
<a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager-org.apache.shiro.cache.CacheManager-"><code>configured</code></a>, <code>false</code> otherwise.
<p/>
The default value is <code>true</code>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if authentication caching should be utilized, <code>false</code> otherwise.</dd>
</dl>
</li>
</ul>
<a name="setAuthenticationCachingEnabled-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAuthenticationCachingEnabled</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.336">setAuthenticationCachingEnabled</a>(boolean&nbsp;authenticationCachingEnabled)</pre>
<div class="block">Sets whether or not authentication caching should be utilized if a <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> has been
<a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager-org.apache.shiro.cache.CacheManager-"><code>configured</code></a>, <code>false</code> otherwise.
<p/>
The default value is <code>false</code> to retain backwards compatibility with Shiro 1.1 and earlier.
<p/>
<b>WARNING:</b> Only set this property to <code>true</code> if safe caching conditions apply, as documented at the top
of this page in the class-level JavaDoc.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>authenticationCachingEnabled</code> - the value to set</dd>
</dl>
</li>
</ul>
<a name="setName-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setName</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.343">setName</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../org/apache/shiro/util/Nameable.html#setName-java.lang.String-">Nameable</a></code></span></div>
<div class="block">Sets the (preferably application unique) name for this component.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../org/apache/shiro/util/Nameable.html#setName-java.lang.String-">setName</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/apache/shiro/util/Nameable.html" title="interface in org.apache.shiro.util">Nameable</a></code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../org/apache/shiro/realm/CachingRealm.html#setName-java.lang.String-">setName</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the preferably application unique name for this component.</dd>
</dl>
</li>
</ul>
<a name="supports-org.apache.shiro.authc.AuthenticationToken-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>supports</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.368">supports</a>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token)</pre>
<div class="block">Convenience implementation that returns
<tt>getAuthenticationTokenClass().isAssignableFrom( token.getClass() );</tt>. Can be overridden
by subclasses for more complex token checking.
<p>Most configurations will only need to set a different class via
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationTokenClass-java.lang.Class-"><code>setAuthenticationTokenClass(java.lang.Class&lt;? extends org.apache.shiro.authc.AuthenticationToken&gt;)</code></a>, as opposed to overriding this method.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../org/apache/shiro/realm/Realm.html#supports-org.apache.shiro.authc.AuthenticationToken-">supports</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>token</code> - the token being submitted for authentication.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this authentication realm can process the submitted token instance of the class, false otherwise.</dd>
</dl>
</li>
</ul>
<a name="init--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre>public final&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.395">init</a>()</pre>
<div class="block">Initializes this realm and potentially enables an authentication cache, depending on configuration. Based on
the availability of an authentication cache, this class functions as follows:
<ol>
<li>If the <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache-org.apache.shiro.cache.Cache-"><code>cache</code></a> property has been set, it will be
used to cache the AuthenticationInfo objects returned from <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-"><code>getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)</code></a>
method invocations.
All future calls to <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-"><code>getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)</code></a> will attempt to use this cache first
to alleviate any potentially unnecessary calls to an underlying data store.</li>
<li>If the <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache-org.apache.shiro.cache.Cache-"><code>cache</code></a> property has <b>not</b> been set,
the <a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager-org.apache.shiro.cache.CacheManager-"><code>cacheManager</code></a> property will be checked.
If a <code>cacheManager</code> has been set, it will be used to eagerly acquire an authentication
<code>cache</code>, and this cache which will be used as specified in #1.</li>
<li>If neither the <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache-org.apache.shiro.cache.Cache-"><code>(org.apache.shiro.cache.Cache) authenticationCache</code></a>
or <a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager-org.apache.shiro.cache.CacheManager-"><code>cacheManager</code></a>
properties are set, caching will not be utilized and authentication look-ups will be delegated to
subclass implementations for each authentication attempt.</li>
</ol>
<p/>
This method finishes by calling <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#onInit--"><code>onInit()</code></a> is to allow subclasses to perform any init behavior desired.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../org/apache/shiro/util/Initializable.html#init--">init</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/apache/shiro/util/Initializable.html" title="interface in org.apache.shiro.util">Initializable</a></code></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
</dl>
</li>
</ul>
<a name="onInit--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onInit</h4>
<pre>protected&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.407">onInit</a>()</pre>
<div class="block">Template method for subclasses to implement any initialization logic. Called from
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#init--"><code>init()</code></a>.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
</dl>
</li>
</ul>
<a name="afterCacheManagerSet--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>afterCacheManagerSet</h4>
<pre>protected&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.415">afterCacheManagerSet</a>()</pre>
<div class="block">This implementation attempts to acquire an authentication cache if one is not already configured.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../org/apache/shiro/realm/CachingRealm.html#afterCacheManagerSet--">afterCacheManagerSet</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</a></code></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
</dl>
</li>
</ul>
<a name="isAuthenticationCachingEnabled-org.apache.shiro.authc.AuthenticationToken-org.apache.shiro.authc.AuthenticationInfo-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAuthenticationCachingEnabled</h4>
<pre>protected&nbsp;boolean&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.538">isAuthenticationCachingEnabled</a>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token,
<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;info)</pre>
<div class="block">Returns <code>true</code> if authentication caching should be utilized based on the specified
<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc"><code>AuthenticationToken</code></a> and/or <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a>, <code>false</code> otherwise.
<p/>
The default implementation simply delegates to <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled--"><code>isAuthenticationCachingEnabled()</code></a>, the general-case
authentication caching setting. Subclasses can override this to turn on or off caching at runtime
based on the specific submitted runtime values.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>token</code> - the submitted authentication token</dd>
<dd><code>info</code> - the <code>AuthenticationInfo</code> acquired from data source lookup via
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#doGetAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-"><code>doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)</code></a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if authentication caching should be utilized based on the specified
<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc"><code>AuthenticationToken</code></a> and/or <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a>, <code>false</code> otherwise.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
</dl>
</li>
</ul>
<a name="getAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAuthenticationInfo</h4>
<pre>public final&nbsp;<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.566">getAuthenticationInfo</a>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token)
throws <a href="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</a></pre>
<div class="block">This implementation functions as follows:
<ol>
<li>It attempts to acquire any cached <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> corresponding to the specified
<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc"><code>AuthenticationToken</code></a> argument. If a cached value is found, it will be used for credentials matching,
alleviating the need to perform any lookups with a data source.</li>
<li>If there is no cached <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> found, delegate to the
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#doGetAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-"><code>doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)</code></a> method to perform the actual
lookup. If authentication caching is enabled and possible, any returned info object will be
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#cacheAuthenticationInfoIfPossible-org.apache.shiro.authc.AuthenticationToken-org.apache.shiro.authc.AuthenticationInfo-"><code>cached</code></a>
to be used in future authentication attempts.</li>
<li>If an AuthenticationInfo instance is not found in the cache or by lookup, <code>null</code> is returned to
indicate an account cannot be found.</li>
<li>If an AuthenticationInfo instance is found (either cached or via lookup), ensure the submitted
AuthenticationToken's credentials match the expected <code>AuthenticationInfo</code>'s credentials using the
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getCredentialsMatcher--"><code>credentialsMatcher</code></a>. This means that credentials are always verified
for an authentication attempt.</li>
</ol></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../org/apache/shiro/realm/Realm.html#getAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-">getAuthenticationInfo</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>token</code> - the submitted account principal and credentials.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the AuthenticationInfo corresponding to the given <code>token</code>, or <code>null</code> if no
AuthenticationInfo could be found.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</a></code> - if authentication failed.</dd>
</dl>
</li>
</ul>
<a name="assertCredentialsMatch-org.apache.shiro.authc.AuthenticationToken-org.apache.shiro.authc.AuthenticationInfo-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assertCredentialsMatch</h4>
<pre>protected&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.597">assertCredentialsMatch</a>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token,
<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;info)
throws <a href="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</a></pre>
<div class="block">Asserts that the submitted <code>AuthenticationToken</code>'s credentials match the stored account
<code>AuthenticationInfo</code>'s credentials, and if not, throws an <a href="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc"><code>AuthenticationException</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>token</code> - the submitted authentication token</dd>
<dd><code>info</code> - the AuthenticationInfo corresponding to the given <code>token</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</a></code> - if the token's credentials do not match the stored account credentials.</dd>
</dl>
</li>
</ul>
<a name="getAuthenticationCacheKey-org.apache.shiro.authc.AuthenticationToken-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAuthenticationCacheKey</h4>
<pre>protected&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.626">getAuthenticationCacheKey</a>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token)</pre>
<div class="block">Returns the key under which <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> instances are cached if authentication caching is enabled.
This implementation defaults to returning the token's
<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html#getPrincipal--"><code>principal</code></a>, which is usually a username in
most applications.
<h3>Cache Invalidation on Logout</h3>
<b>NOTE:</b> If you want to be able to invalidate an account's cached <code>AuthenticationInfo</code> on logout, you
must ensure the <a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey-org.apache.shiro.subject.PrincipalCollection-"><code>getAuthenticationCacheKey(org.apache.shiro.subject.PrincipalCollection)</code></a> method returns
the same value as this method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>token</code> - the authentication token for which any successful authentication will be cached.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the cache key to use to cache the associated <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> after a successful authentication.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
</dl>
</li>
</ul>
<a name="getAuthenticationCacheKey-org.apache.shiro.subject.PrincipalCollection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAuthenticationCacheKey</h4>
<pre>protected&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.644">getAuthenticationCacheKey</a>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a>&nbsp;principals)</pre>
<div class="block">Returns the key under which <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> instances are cached if authentication caching is enabled.
This implementation delegates to
<a href="../../../../org/apache/shiro/realm/CachingRealm.html#getAvailablePrincipal-org.apache.shiro.subject.PrincipalCollection-"><code>CachingRealm.getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)</code></a>, which returns the primary principal
associated with this particular Realm.
<h3>Cache Invalidation on Logout</h3>
<b>NOTE:</b> If you want to be able to invalidate an account's cached <code>AuthenticationInfo</code> on logout, you
must ensure that this method returns the same value as the
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey-org.apache.shiro.authc.AuthenticationToken-"><code>getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)</code></a> method!</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>principals</code> - the principals of the account for which to set or remove cached <code>AuthenticationInfo</code>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the cache key to use when looking up cached <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> instances.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
</dl>
</li>
</ul>
<a name="doClearCache-org.apache.shiro.subject.PrincipalCollection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doClearCache</h4>
<pre>protected&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.657">doClearCache</a>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a>&nbsp;principals)</pre>
<div class="block">This implementation clears out any cached authentication data by calling
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#clearCachedAuthenticationInfo-org.apache.shiro.subject.PrincipalCollection-"><code>clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection)</code></a>.
If overriding in a subclass, be sure to call <code>super.doClearCache</code> to ensure this behavior is maintained.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../org/apache/shiro/realm/CachingRealm.html#doClearCache-org.apache.shiro.subject.PrincipalCollection-">doClearCache</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>principals</code> - principals the principals of the account for which to clear any cached data.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
</dl>
</li>
</ul>
<a name="clearCachedAuthenticationInfo-org.apache.shiro.subject.PrincipalCollection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearCachedAuthenticationInfo</h4>
<pre>protected&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.686">clearCachedAuthenticationInfo</a>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a>&nbsp;principals)</pre>
<div class="block">Clears out the AuthenticationInfo cache entry for the specified account.
<p/>
This method is provided as a convenience to subclasses so they can invalidate a cache entry when they
change an account's authentication data (e.g. reset password) during runtime. Because an account's
AuthenticationInfo can be cached, there needs to be a way to invalidate the cache for only that account so that
subsequent authentication operations don't used the (old) cached value if account data changes.
<p/>
After this method is called, the next authentication for that same account will result in a call to
<a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#doGetAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-"><code>doGetAuthenticationInfo</code></a>, and the
resulting return value will be cached before being returned so it can be reused for later authentications.
<p/>
If you wish to clear out all associated cached data (and not just authentication data), use the
<a href="../../../../org/apache/shiro/realm/CachingRealm.html#clearCache-org.apache.shiro.subject.PrincipalCollection-"><code>CachingRealm.clearCache(org.apache.shiro.subject.PrincipalCollection)</code></a> method instead (which will in turn call this
method by default).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>principals</code> - the principals of the account for which to clear the cached AuthorizationInfo.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/apache/shiro/realm/CachingRealm.html#clearCache-org.apache.shiro.subject.PrincipalCollection-"><code>CachingRealm.clearCache(org.apache.shiro.subject.PrincipalCollection)</code></a></dd>
</dl>
</li>
</ul>
<a name="doGetAuthenticationInfo-org.apache.shiro.authc.AuthenticationToken-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>doGetAuthenticationInfo</h4>
<pre>protected abstract&nbsp;<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.713">doGetAuthenticationInfo</a>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token)
throws <a href="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</a></pre>
<div class="block">Retrieves authentication data from an implementation-specific datasource (RDBMS, LDAP, etc) for the given
authentication token.
<p/>
For most datasources, this means just 'pulling' authentication data for an associated subject/user and nothing
more and letting Shiro do the rest. But in some systems, this method could actually perform EIS specific
log-in logic in addition to just retrieving data - it is up to the Realm implementation.
<p/>
A <code>null</code> return value means that no account could be associated with the specified token.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>token</code> - the authentication token containing the user's principal and credentials.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an <a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> object containing account data resulting from the
authentication ONLY if the lookup is successful (i.e. account exists and is valid, etc.)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</a></code> - if there is an error acquiring data or performing
realm-specific authentication logic for the specified <tt>token</tt></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/AuthenticatingRealm.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/shiro/realm/AuthorizingRealm.html" title="class in org.apache.shiro.realm"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/shiro/realm/AuthenticatingRealm.html" target="_top">Frames</a></li>
<li><a href="AuthenticatingRealm.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>Nested&nbsp;|&nbsp;</li>
<li>Field&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>Field&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; 2004&#x2013;2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>