blob: 87ce68cf56ea4cc350bc2e45de0416cfbcaa445d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_65) on Tue Feb 25 18:15:48 EST 2014 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
AuthenticatingRealm (Apache Shiro 1.2.3 API)
</TITLE>
<META NAME="date" CONTENT="2014-02-25">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="AuthenticatingRealm (Apache Shiro 1.2.3 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AuthenticatingRealm.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/realm/AuthorizingRealm.html" title="class in org.apache.shiro.realm"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/shiro/realm/AuthenticatingRealm.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AuthenticatingRealm.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.shiro.realm</FONT>
<BR>
Class AuthenticatingRealm</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">org.apache.shiro.realm.CachingRealm</A>
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.shiro.realm.AuthenticatingRealm</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <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><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../org/apache/shiro/realm/AuthorizingRealm.html" title="class in org.apache.shiro.realm">AuthorizingRealm</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public abstract class <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.110"><B>AuthenticatingRealm</B></A><DT>extends <A HREF="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</A><DT>implements <A HREF="../../../../org/apache/shiro/util/Initializable.html" title="interface in org.apache.shiro.util">Initializable</A></DL>
</PRE>
<P>
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.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>0.2</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#AuthenticatingRealm()">AuthenticatingRealm</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#AuthenticatingRealm(org.apache.shiro.cache.CacheManager)">AuthenticatingRealm</A></B>(<A HREF="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache">CacheManager</A>&nbsp;cacheManager)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#AuthenticatingRealm(org.apache.shiro.cache.CacheManager, org.apache.shiro.authc.credential.CredentialsMatcher)">AuthenticatingRealm</A></B>(<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>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#AuthenticatingRealm(org.apache.shiro.authc.credential.CredentialsMatcher)">AuthenticatingRealm</A></B>(<A HREF="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</A>&nbsp;matcher)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#afterCacheManagerSet()">afterCacheManagerSet</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This implementation attempts to acquire an authentication cache if one is not already configured.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#assertCredentialsMatch(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)">assertCredentialsMatch</A></B>(<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>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection)">clearCachedAuthenticationInfo</A></B>(<A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</A>&nbsp;principals)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clears out the AuthenticationInfo cache entry for the specified account.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#doClearCache(org.apache.shiro.subject.PrincipalCollection)">doClearCache</A></B>(<A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</A>&nbsp;principals)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected abstract &nbsp;<A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)">doGetAuthenticationInfo</A></B>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves authentication data from an implementation-specific datasource (RDBMS, LDAP, etc) for the given
authentication token.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache">Cache</A>&lt;<A HREF="http://java.sun.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></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCache()">getAuthenticationCache</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)">getAuthenticationCacheKey</A></B>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheKey(org.apache.shiro.subject.PrincipalCollection)">getAuthenticationCacheKey</A></B>(<A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</A>&nbsp;principals)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationCacheName()">getAuthenticationCacheName</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)">getAuthenticationInfo</A></B>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationTokenClass()">getAuthenticationTokenClass</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the authenticationToken class supported by this realm.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getCredentialsMatcher()">getCredentialsMatcher</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>CredentialsMatcher</code> used during an authentication attempt to verify submitted
credentials with those stored in the system.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#init()">init</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes this realm and potentially enables an authentication cache, depending on configuration.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled()">isAuthenticationCachingEnabled</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)">isAuthenticationCachingEnabled</A></B>(<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>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#onInit()">onInit</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Template method for subclasses to implement any initialization logic.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCache(org.apache.shiro.cache.Cache)">setAuthenticationCache</A></B>(<A HREF="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache">Cache</A>&lt;<A HREF="http://java.sun.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>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCacheName(java.lang.String)">setAuthenticationCacheName</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;authenticationCacheName)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationCachingEnabled(boolean)">setAuthenticationCachingEnabled</A></B>(boolean&nbsp;authenticationCachingEnabled)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationTokenClass(java.lang.Class)">setAuthenticationTokenClass</A></B>(<A HREF="http://java.sun.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>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the authenticationToken class supported by this realm.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setCredentialsMatcher(org.apache.shiro.authc.credential.CredentialsMatcher)">setCredentialsMatcher</A></B>(<A HREF="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</A>&nbsp;credentialsMatcher)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the CrendialsMatcher used during an authentication attempt to verify submitted credentials with those
stored in the system.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setName(java.lang.String)">setName</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the (preferably application unique) name for this component.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#supports(org.apache.shiro.authc.AuthenticationToken)">supports</A></B>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convenience implementation that returns
<tt>getAuthenticationTokenClass().isAssignableFrom( token.getClass() );</tt>.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.shiro.realm.CachingRealm"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.shiro.realm.<A HREF="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><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></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.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://java.sun.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://java.sun.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://java.sun.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://java.sun.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://java.sun.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://java.sun.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://java.sun.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://java.sun.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://java.sun.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://java.sun.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></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="AuthenticatingRealm()"><!-- --></A><H3>
AuthenticatingRealm</H3>
<PRE>
public <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.146"><B>AuthenticatingRealm</B></A>()</PRE>
<DL>
</DL>
<HR>
<A NAME="AuthenticatingRealm(org.apache.shiro.cache.CacheManager)"><!-- --></A><H3>
AuthenticatingRealm</H3>
<PRE>
public <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.150"><B>AuthenticatingRealm</B></A>(<A HREF="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache">CacheManager</A>&nbsp;cacheManager)</PRE>
<DL>
</DL>
<HR>
<A NAME="AuthenticatingRealm(org.apache.shiro.authc.credential.CredentialsMatcher)"><!-- --></A><H3>
AuthenticatingRealm</H3>
<PRE>
public <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.154"><B>AuthenticatingRealm</B></A>(<A HREF="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</A>&nbsp;matcher)</PRE>
<DL>
</DL>
<HR>
<A NAME="AuthenticatingRealm(org.apache.shiro.cache.CacheManager, org.apache.shiro.authc.credential.CredentialsMatcher)"><!-- --></A><H3>
AuthenticatingRealm</H3>
<PRE>
public <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.158"><B>AuthenticatingRealm</B></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>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="getCredentialsMatcher()"><!-- --></A><H3>
getCredentialsMatcher</H3>
<PRE>
public <A HREF="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</A> <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.193"><B>getCredentialsMatcher</B></A>()</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the <code>CredentialsMatcher</code> used during an authentication attempt to verify submitted
credentials with those stored in the system.</DL>
</DD>
</DL>
<HR>
<A NAME="setCredentialsMatcher(org.apache.shiro.authc.credential.CredentialsMatcher)"><!-- --></A><H3>
setCredentialsMatcher</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.207"><B>setCredentialsMatcher</B></A>(<A HREF="../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</A>&nbsp;credentialsMatcher)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>credentialsMatcher</CODE> - the matcher to use.</DL>
</DD>
</DL>
<HR>
<A NAME="getAuthenticationTokenClass()"><!-- --></A><H3>
getAuthenticationTokenClass</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A> <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.225"><B>getAuthenticationTokenClass</B></A>()</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the authenticationToken class supported by this realm.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#setAuthenticationTokenClass(java.lang.Class)"><CODE>setAuthenticationTokenClass(java.lang.Class<? extends org.apache.shiro.authc.AuthenticationToken>)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setAuthenticationTokenClass(java.lang.Class)"><!-- --></A><H3>
setAuthenticationTokenClass</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.238"><B>setAuthenticationTokenClass</B></A>(<A HREF="http://java.sun.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>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>authenticationTokenClass</CODE> - the class of authentication token instances supported by this realm.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#getAuthenticationTokenClass()"><CODE>getAuthenticationTokenClass() for more explanation.</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setAuthenticationCache(org.apache.shiro.cache.Cache)"><!-- --></A><H3>
setAuthenticationCache</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.255"><B>setAuthenticationCache</B></A>(<A HREF="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache">Cache</A>&lt;<A HREF="http://java.sun.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>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><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.<DT><B>Since:</B></DT>
<DD>1.2</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled()"><CODE>isAuthenticationCachingEnabled()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getAuthenticationCache()"><!-- --></A><H3>
getAuthenticationCache</H3>
<PRE>
public <A HREF="../../../../org/apache/shiro/cache/Cache.html" title="interface in org.apache.shiro.cache">Cache</A>&lt;<A HREF="http://java.sun.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; <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.269"><B>getAuthenticationCache</B></A>()</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><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.<DT><B>Since:</B></DT>
<DD>1.2</DD>
<DT><B>See Also:</B><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></DL>
</DD>
</DL>
<HR>
<A NAME="getAuthenticationCacheName()"><!-- --></A><H3>
getAuthenticationCacheName</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.288"><B>getAuthenticationCacheName</B></A>()</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><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>.<DT><B>Since:</B></DT>
<DD>1.2</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled()"><CODE>isAuthenticationCachingEnabled()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setAuthenticationCacheName(java.lang.String)"><!-- --></A><H3>
setAuthenticationCacheName</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.305"><B>setAuthenticationCacheName</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;authenticationCacheName)</PRE>
<DL>
<DD>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>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><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>.<DT><B>Since:</B></DT>
<DD>1.2</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#isAuthenticationCachingEnabled()"><CODE>isAuthenticationCachingEnabled()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="isAuthenticationCachingEnabled()"><!-- --></A><H3>
isAuthenticationCachingEnabled</H3>
<PRE>
public boolean <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.317"><B>isAuthenticationCachingEnabled</B></A>()</PRE>
<DL>
<DD>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>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if authentication caching should be utilized, <code>false</code> otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="setAuthenticationCachingEnabled(boolean)"><!-- --></A><H3>
setAuthenticationCachingEnabled</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.333"><B>setAuthenticationCachingEnabled</B></A>(boolean&nbsp;authenticationCachingEnabled)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>authenticationCachingEnabled</CODE> - the value to set</DL>
</DD>
</DL>
<HR>
<A NAME="setName(java.lang.String)"><!-- --></A><H3>
setName</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.340"><B>setName</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../org/apache/shiro/util/Nameable.html#setName(java.lang.String)">Nameable</A></CODE></B></DD>
<DD>Sets the (preferably application unique) name for this component.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/shiro/util/Nameable.html#setName(java.lang.String)">setName</A></CODE> in interface <CODE><A HREF="../../../../org/apache/shiro/util/Nameable.html" title="interface in org.apache.shiro.util">Nameable</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/shiro/realm/CachingRealm.html#setName(java.lang.String)">setName</A></CODE> in class <CODE><A HREF="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the preferably application unique name for this component.</DL>
</DD>
</DL>
<HR>
<A NAME="supports(org.apache.shiro.authc.AuthenticationToken)"><!-- --></A><H3>
supports</H3>
<PRE>
public boolean <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.365"><B>supports</B></A>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token)</PRE>
<DL>
<DD>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<? extends org.apache.shiro.authc.AuthenticationToken>)</CODE></A>, as opposed to overriding this method.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/shiro/realm/Realm.html#supports(org.apache.shiro.authc.AuthenticationToken)">supports</A></CODE> in interface <CODE><A HREF="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>token</CODE> - the token being submitted for authentication.
<DT><B>Returns:</B><DD>true if this authentication realm can process the submitted token instance of the class, false otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="init()"><!-- --></A><H3>
init</H3>
<PRE>
public final void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.392"><B>init</B></A>()</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/shiro/util/Initializable.html#init()">init</A></CODE> in interface <CODE><A HREF="../../../../org/apache/shiro/util/Initializable.html" title="interface in org.apache.shiro.util">Initializable</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="onInit()"><!-- --></A><H3>
onInit</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.404"><B>onInit</B></A>()</PRE>
<DL>
<DD>Template method for subclasses to implement any initialization logic. Called from
<A HREF="../../../../org/apache/shiro/realm/AuthenticatingRealm.html#init()"><CODE>init()</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="afterCacheManagerSet()"><!-- --></A><H3>
afterCacheManagerSet</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.412"><B>afterCacheManagerSet</B></A>()</PRE>
<DL>
<DD>This implementation attempts to acquire an authentication cache if one is not already configured.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/shiro/realm/CachingRealm.html#afterCacheManagerSet()">afterCacheManagerSet</A></CODE> in class <CODE><A HREF="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="isAuthenticationCachingEnabled(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)"><!-- --></A><H3>
isAuthenticationCachingEnabled</H3>
<PRE>
protected boolean <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.535"><B>isAuthenticationCachingEnabled</B></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>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>token</CODE> - the submitted authentication token<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>
<DT><B>Returns:</B><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.<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)"><!-- --></A><H3>
getAuthenticationInfo</H3>
<PRE>
public final <A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</A> <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.563"><B>getAuthenticationInfo</B></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>
<DL>
<DD>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>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/shiro/realm/Realm.html#getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)">getAuthenticationInfo</A></CODE> in interface <CODE><A HREF="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>token</CODE> - the submitted account principal and credentials.
<DT><B>Returns:</B><DD>the AuthenticationInfo corresponding to the given <code>token</code>, or <code>null</code> if no
AuthenticationInfo could be found.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</A></CODE> - if authentication failed.</DL>
</DD>
</DL>
<HR>
<A NAME="assertCredentialsMatch(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)"><!-- --></A><H3>
assertCredentialsMatch</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.594"><B>assertCredentialsMatch</B></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>
<DL>
<DD>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>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>token</CODE> - the submitted authentication token<DD><CODE>info</CODE> - the AuthenticationInfo corresponding to the given <code>token</code>
<DT><B>Throws:</B>
<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.</DL>
</DD>
</DL>
<HR>
<A NAME="getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)"><!-- --></A><H3>
getAuthenticationCacheKey</H3>
<PRE>
protected <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.623"><B>getAuthenticationCacheKey</B></A>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>token</CODE> - the authentication token for which any successful authentication will be cached.
<DT><B>Returns:</B><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.<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getAuthenticationCacheKey(org.apache.shiro.subject.PrincipalCollection)"><!-- --></A><H3>
getAuthenticationCacheKey</H3>
<PRE>
protected <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.641"><B>getAuthenticationCacheKey</B></A>(<A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</A>&nbsp;principals)</PRE>
<DL>
<DD>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!
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>principals</CODE> - the principals of the account for which to set or remove cached <code>AuthenticationInfo</code>.
<DT><B>Returns:</B><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.<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="doClearCache(org.apache.shiro.subject.PrincipalCollection)"><!-- --></A><H3>
doClearCache</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.654"><B>doClearCache</B></A>(<A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</A>&nbsp;principals)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/shiro/realm/CachingRealm.html#doClearCache(org.apache.shiro.subject.PrincipalCollection)">doClearCache</A></CODE> in class <CODE><A HREF="../../../../org/apache/shiro/realm/CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>principals</CODE> - principals the principals of the account for which to clear any cached data.<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection)"><!-- --></A><H3>
clearCachedAuthenticationInfo</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.679"><B>clearCachedAuthenticationInfo</B></A>(<A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</A>&nbsp;principals)</PRE>
<DL>
<DD>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).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>principals</CODE> - the principals of the account for which to clear the cached AuthorizationInfo.<DT><B>Since:</B></DT>
<DD>1.2</DD>
<DT><B>See Also:</B><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></DL>
</DD>
</DL>
<HR>
<A NAME="doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)"><!-- --></A><H3>
doGetAuthenticationInfo</H3>
<PRE>
protected abstract <A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</A> <A HREF="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.706"><B>doGetAuthenticationInfo</B></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>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>token</CODE> - the authentication token containing the user's principal and credentials.
<DT><B>Returns:</B><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.)
<DT><B>Throws:</B>
<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></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AuthenticatingRealm.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/realm/AuthorizingRealm.html" title="class in org.apache.shiro.realm"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/shiro/realm/AuthenticatingRealm.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AuthenticatingRealm.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2004-2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>