| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="fr"> |
| <head> |
| <!-- Generated by javadoc (11.0.4) on Fri Jan 24 17:11:59 CET 2020 --> |
| <title>AuthenticatingRealm (Apache Shiro :: Core 1.5.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2020-01-24"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="AuthenticatingRealm (Apache Shiro :: Core 1.5.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"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"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/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" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.shiro.realm</a></div> |
| <h2 title="Class AuthenticatingRealm" class="title">Class AuthenticatingRealm</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="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><code><a href="../authc/LogoutAware.html" title="interface in org.apache.shiro.authc">LogoutAware</a></code>, <code>org.apache.shiro.cache.CacheManagerAware</code>, <code><a href="Realm.html" title="interface in org.apache.shiro.realm">Realm</a></code>, <code>org.apache.shiro.util.Initializable</code>, <code>org.apache.shiro.util.Nameable</code></dd> |
| </dl> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><code><a href="AuthorizingRealm.html" title="class in org.apache.shiro.realm">AuthorizingRealm</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public abstract class <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.113">AuthenticatingRealm</a> |
| extends <a href="CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</a> |
| implements org.apache.shiro.util.Initializable</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="#setAuthenticationCachingEnabled(boolean)"><code>authenticationCachingEnabled</code></a> = <code>true</code> |
| (and configuring Shiro with a <code>CacheManager</code> 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="#doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)"><code>doGetAuthenticationInfo</code></a> |
| implementation returns <code>AuthenticationInfo</code> instances where the |
| <a href="../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="../authc/AuthenticationInfo.html#getCredentials()"><code>credentials</code></a> are safely hashed and salted or otherwise |
| fully encrypted.<br/><br/></li> |
| <li>The <a href="#doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)"><code>doGetAuthenticationInfo</code></a> |
| implementation returns <code>AuthenticationInfo</code> instances where the |
| <a href="../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="#getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)"><code>getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)</code></a> and |
| <a href="#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="../authc/AuthenticationToken.html#getPrincipal()"><code>AuthenticationToken.getPrincipal()</code></a> (what the user submits during login) and |
| <a href="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="#getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)"><code>getAuthenticationCacheKey(token)</code></a> or |
| <a href="#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="#getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)"><code>getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)</code></a> and |
| <a href="#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 ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">AuthenticatingRealm</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.shiro.authc.credential.CredentialsMatcher)">AuthenticatingRealm</a></span>​(<a href="../authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a> matcher)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.shiro.cache.CacheManager)">AuthenticatingRealm</a></span>​(org.apache.shiro.cache.CacheManager cacheManager)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.shiro.cache.CacheManager,org.apache.shiro.authc.credential.CredentialsMatcher)">AuthenticatingRealm</a></span>​(org.apache.shiro.cache.CacheManager cacheManager, |
| <a href="../authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a> matcher)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#afterCacheManagerSet()">afterCacheManagerSet</a></span>()</code></th> |
| <td class="colLast"> |
| <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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#assertCredentialsMatch(org.apache.shiro.authc.AuthenticationToken,org.apache.shiro.authc.AuthenticationInfo)">assertCredentialsMatch</a></span>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token, |
| <a href="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a> info)</code></th> |
| <td class="colLast"> |
| <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="../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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection)">clearCachedAuthenticationInfo</a></span>​(<a href="../subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</code></th> |
| <td class="colLast"> |
| <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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doClearCache(org.apache.shiro.subject.PrincipalCollection)">doClearCache</a></span>​(<a href="../subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</code></th> |
| <td class="colLast"> |
| <div class="block">This implementation clears out any cached authentication data by calling |
| <a href="#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="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)">doGetAuthenticationInfo</a></span>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</code></th> |
| <td class="colLast"> |
| <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>org.apache.shiro.cache.Cache<<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,​<a href="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAuthenticationCache()">getAuthenticationCache</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a <code>Cache</code> 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="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)">getAuthenticationCacheKey</a></span>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the key under which <a href="../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="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAuthenticationCacheKey(org.apache.shiro.subject.PrincipalCollection)">getAuthenticationCacheKey</a></span>​(<a href="../subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the key under which <a href="../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="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAuthenticationCacheName()">getAuthenticationCacheName</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the name of a <code>Cache</code> to lookup from any available <a href="CachingRealm.html#getCacheManager()"><code>cacheManager</code></a> if |
| a cache is not explicitly configured via <a href="#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="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)">getAuthenticationInfo</a></span>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</code></th> |
| <td class="colLast"> |
| <div class="block">This implementation functions as follows: |
| |
| It attempts to acquire any cached <a href="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> corresponding to the specified |
| <a href="../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="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAuthenticationTokenClass()">getAuthenticationTokenClass</a></span>()</code></th> |
| <td class="colLast"> |
| <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="../authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCredentialsMatcher()">getCredentialsMatcher</a></span>()</code></th> |
| <td class="colLast"> |
| <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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#init()">init</a></span>()</code></th> |
| <td class="colLast"> |
| <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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAuthenticationCachingEnabled()">isAuthenticationCachingEnabled</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if authentication caching should be utilized if a <code>CacheManager</code> has been |
| <a href="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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAuthenticationCachingEnabled(org.apache.shiro.authc.AuthenticationToken,org.apache.shiro.authc.AuthenticationInfo)">isAuthenticationCachingEnabled</a></span>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token, |
| <a href="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a> info)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if authentication caching should be utilized based on the specified |
| <a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc"><code>AuthenticationToken</code></a> and/or <a href="../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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onInit()">onInit</a></span>()</code></th> |
| <td class="colLast"> |
| <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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAuthenticationCache(org.apache.shiro.cache.Cache)">setAuthenticationCache</a></span>​(org.apache.shiro.cache.Cache<<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,​<a href="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>> authenticationCache)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets an explicit <code>Cache</code> instance to use for authentication caching.</div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAuthenticationCacheName(java.lang.String)">setAuthenticationCacheName</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> authenticationCacheName)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets the name of a <code>Cache</code> to lookup from any available <a href="CachingRealm.html#getCacheManager()"><code>cacheManager</code></a> if |
| a cache is not explicitly configured via <a href="#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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAuthenticationCachingEnabled(boolean)">setAuthenticationCachingEnabled</a></span>​(boolean authenticationCachingEnabled)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets whether or not authentication caching should be utilized if a <code>CacheManager</code> has been |
| <a href="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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAuthenticationTokenClass(java.lang.Class)">setAuthenticationTokenClass</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><? extends <a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>> authenticationTokenClass)</code></th> |
| <td class="colLast"> |
| <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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setCredentialsMatcher(org.apache.shiro.authc.credential.CredentialsMatcher)">setCredentialsMatcher</a></span>​(<a href="../authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a> credentialsMatcher)</code></th> |
| <td class="colLast"> |
| <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> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setName(java.lang.String)">setName</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> name)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i22" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#supports(org.apache.shiro.authc.AuthenticationToken)">supports</a></span>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</code></th> |
| <td class="colLast"> |
| <div class="block">Convenience implementation that returns |
| <tt>getAuthenticationTokenClass().isAssignableFrom( token.getClass() );</tt>.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.org.apache.shiro.realm.CachingRealm"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class org.apache.shiro.realm.<a href="CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</a></h3> |
| <code><a href="CachingRealm.html#clearCache(org.apache.shiro.subject.PrincipalCollection)">clearCache</a>, <a href="CachingRealm.html#getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)">getAvailablePrincipal</a>, <a href="CachingRealm.html#getCacheManager()">getCacheManager</a>, <a href="CachingRealm.html#getName()">getName</a>, <a href="CachingRealm.html#isCachingEnabled()">isCachingEnabled</a>, <a href="CachingRealm.html#onLogout(org.apache.shiro.subject.PrincipalCollection)">onLogout</a>, <a href="CachingRealm.html#setCacheManager(org.apache.shiro.cache.CacheManager)">setCacheManager</a>, <a href="CachingRealm.html#setCachingEnabled(boolean)">setCachingEnabled</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>AuthenticatingRealm</h4> |
| <pre>public <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.149">AuthenticatingRealm</a>()</pre> |
| </li> |
| </ul> |
| <a id="<init>(org.apache.shiro.cache.CacheManager)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>AuthenticatingRealm</h4> |
| <pre>public <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.153">AuthenticatingRealm</a>​(org.apache.shiro.cache.CacheManager cacheManager)</pre> |
| </li> |
| </ul> |
| <a id="<init>(org.apache.shiro.authc.credential.CredentialsMatcher)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>AuthenticatingRealm</h4> |
| <pre>public <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.157">AuthenticatingRealm</a>​(<a href="../authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a> matcher)</pre> |
| </li> |
| </ul> |
| <a id="<init>(org.apache.shiro.cache.CacheManager,org.apache.shiro.authc.credential.CredentialsMatcher)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>AuthenticatingRealm</h4> |
| <pre>public <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.161">AuthenticatingRealm</a>​(org.apache.shiro.cache.CacheManager cacheManager, |
| <a href="../authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a> matcher)</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="getCredentialsMatcher()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCredentialsMatcher</h4> |
| <pre class="methodSignature">public <a href="../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.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="#setCredentialsMatcher(org.apache.shiro.authc.credential.CredentialsMatcher)"><code>setCredentialsMatcher</code></a> method, the default |
| value is a <a href="../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 id="setCredentialsMatcher(org.apache.shiro.authc.credential.CredentialsMatcher)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setCredentialsMatcher</h4> |
| <pre class="methodSignature">public void <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.210">setCredentialsMatcher</a>​(<a href="../authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential">CredentialsMatcher</a> 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="../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 id="getAuthenticationTokenClass()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAuthenticationTokenClass</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a> <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="../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="Realm.html#supports(org.apache.shiro.authc.AuthenticationToken)"><code>Realm.supports(AuthenticationToken)</code></a> method, |
| they must <a href="#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="#setAuthenticationTokenClass(java.lang.Class)"><code>setAuthenticationTokenClass(java.lang.Class<? extends org.apache.shiro.authc.AuthenticationToken>)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setAuthenticationTokenClass(java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAuthenticationTokenClass</h4> |
| <pre class="methodSignature">public void <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.241">setAuthenticationTokenClass</a>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><? extends <a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>> 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="../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="#getAuthenticationTokenClass()"><code>getAuthenticationTokenClass() for more explanation.</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setAuthenticationCache(org.apache.shiro.cache.Cache)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAuthenticationCache</h4> |
| <pre class="methodSignature">public void <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.258">setAuthenticationCache</a>​(org.apache.shiro.cache.Cache<<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,​<a href="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>> authenticationCache)</pre> |
| <div class="block">Sets an explicit <code>Cache</code> instance to use for authentication caching. If not set and authentication |
| caching is <a href="#isAuthenticationCachingEnabled()"><code>enabled</code></a>, any available |
| <a href="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 <code>Cache</code> 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="#isAuthenticationCachingEnabled()"><code>isAuthenticationCachingEnabled()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getAuthenticationCache()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAuthenticationCache</h4> |
| <pre class="methodSignature">public org.apache.shiro.cache.Cache<<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,​<a href="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>> <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.272">getAuthenticationCache</a>()</pre> |
| <div class="block">Returns a <code>Cache</code> 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 <code>Cache</code> 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="#setAuthenticationCache(org.apache.shiro.cache.Cache)"><code>setAuthenticationCache(org.apache.shiro.cache.Cache)</code></a>, |
| <a href="#isAuthenticationCachingEnabled()"><code>isAuthenticationCachingEnabled()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getAuthenticationCacheName()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAuthenticationCacheName</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.291">getAuthenticationCacheName</a>()</pre> |
| <div class="block">Returns the name of a <code>Cache</code> to lookup from any available <a href="CachingRealm.html#getCacheManager()"><code>cacheManager</code></a> if |
| a cache is not explicitly configured via <a href="#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="#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 <code>Cache</code> to lookup from any available <a href="CachingRealm.html#getCacheManager()"><code>cacheManager</code></a> if |
| a cache is not explicitly configured via <a href="#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="#isAuthenticationCachingEnabled()"><code>isAuthenticationCachingEnabled()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setAuthenticationCacheName(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAuthenticationCacheName</h4> |
| <pre class="methodSignature">public void <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.308">setAuthenticationCacheName</a>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> authenticationCacheName)</pre> |
| <div class="block">Sets the name of a <code>Cache</code> to lookup from any available <a href="CachingRealm.html#getCacheManager()"><code>cacheManager</code></a> if |
| a cache is not explicitly configured via <a href="#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="#isAuthenticationCachingEnabled()"><code>enabled</code></a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>authenticationCacheName</code> - the name of a <code>Cache</code> to lookup from any available |
| <a href="CachingRealm.html#getCacheManager()"><code>cacheManager</code></a> if a cache is not explicitly configured |
| via <a href="#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="#isAuthenticationCachingEnabled()"><code>isAuthenticationCachingEnabled()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isAuthenticationCachingEnabled()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isAuthenticationCachingEnabled</h4> |
| <pre class="methodSignature">public boolean <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 <code>CacheManager</code> has been |
| <a href="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 id="setAuthenticationCachingEnabled(boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAuthenticationCachingEnabled</h4> |
| <pre class="methodSignature">public void <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.335">setAuthenticationCachingEnabled</a>​(boolean authenticationCachingEnabled)</pre> |
| <div class="block">Sets whether or not authentication caching should be utilized if a <code>CacheManager</code> has been |
| <a href="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 id="setName(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setName</h4> |
| <pre class="methodSignature">public void <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.343">setName</a>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> name)</pre> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code>setName</code> in interface <code>org.apache.shiro.util.Nameable</code></dd> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="CachingRealm.html#setName(java.lang.String)">setName</a></code> in class <code><a href="CachingRealm.html" title="class in org.apache.shiro.realm">CachingRealm</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="supports(org.apache.shiro.authc.AuthenticationToken)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>supports</h4> |
| <pre class="methodSignature">public boolean <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.368">supports</a>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> 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="#setAuthenticationTokenClass(java.lang.Class)"><code>setAuthenticationTokenClass(java.lang.Class<? extends org.apache.shiro.authc.AuthenticationToken>)</code></a>, as opposed to overriding this method.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="Realm.html#supports(org.apache.shiro.authc.AuthenticationToken)">supports</a></code> in interface <code><a href="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 id="init()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>init</h4> |
| <pre class="methodSignature">public final void <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="#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="#getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)"><code>getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)</code></a> |
| method invocations. |
| All future calls to <a href="#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="#setAuthenticationCache(org.apache.shiro.cache.Cache)"><code>cache</code></a> property has <b>not</b> been set, |
| the <a href="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="#setAuthenticationCache(org.apache.shiro.cache.Cache)"><code>(org.apache.shiro.cache.Cache) authenticationCache</code></a> |
| or <a href="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="#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>init</code> in interface <code>org.apache.shiro.util.Initializable</code></dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.2</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="onInit()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onInit</h4> |
| <pre class="methodSignature">protected void <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="#init()"><code>init()</code></a>.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.2</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="afterCacheManagerSet()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>afterCacheManagerSet</h4> |
| <pre class="methodSignature">protected void <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="CachingRealm.html#afterCacheManagerSet()">afterCacheManagerSet</a></code> in class <code><a href="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 id="isAuthenticationCachingEnabled(org.apache.shiro.authc.AuthenticationToken,org.apache.shiro.authc.AuthenticationInfo)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isAuthenticationCachingEnabled</h4> |
| <pre class="methodSignature">protected boolean <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.538">isAuthenticationCachingEnabled</a>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token, |
| <a href="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a> info)</pre> |
| <div class="block">Returns <code>true</code> if authentication caching should be utilized based on the specified |
| <a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc"><code>AuthenticationToken</code></a> and/or <a href="../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="#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="#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="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc"><code>AuthenticationToken</code></a> and/or <a href="../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 id="getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAuthenticationInfo</h4> |
| <pre class="methodSignature">public final <a href="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a> <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.566">getAuthenticationInfo</a>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token) |
| throws <a href="../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="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> corresponding to the specified |
| <a href="../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="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> found, delegate to the |
| <a href="#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="#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="#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="Realm.html#getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)">getAuthenticationInfo</a></code> in interface <code><a href="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="../authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</a></code> - if authentication failed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="assertCredentialsMatch(org.apache.shiro.authc.AuthenticationToken,org.apache.shiro.authc.AuthenticationInfo)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>assertCredentialsMatch</h4> |
| <pre class="methodSignature">protected void <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.597">assertCredentialsMatch</a>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token, |
| <a href="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a> info) |
| throws <a href="../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="../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="../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 id="getAuthenticationCacheKey(org.apache.shiro.authc.AuthenticationToken)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAuthenticationCacheKey</h4> |
| <pre class="methodSignature">protected <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.626">getAuthenticationCacheKey</a>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</pre> |
| <div class="block">Returns the key under which <a href="../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="../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="#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="../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 id="getAuthenticationCacheKey(org.apache.shiro.subject.PrincipalCollection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAuthenticationCacheKey</h4> |
| <pre class="methodSignature">protected <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.644">getAuthenticationCacheKey</a>​(<a href="../subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</pre> |
| <div class="block">Returns the key under which <a href="../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="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="#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="../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 id="doClearCache(org.apache.shiro.subject.PrincipalCollection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>doClearCache</h4> |
| <pre class="methodSignature">protected void <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.656">doClearCache</a>​(<a href="../subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</pre> |
| <div class="block">This implementation clears out any cached authentication data by calling |
| <a href="#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="CachingRealm.html#doClearCache(org.apache.shiro.subject.PrincipalCollection)">doClearCache</a></code> in class <code><a href="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 id="clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>clearCachedAuthenticationInfo</h4> |
| <pre class="methodSignature">protected void <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.686">clearCachedAuthenticationInfo</a>​(<a href="../subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> 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="#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="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="CachingRealm.html#clearCache(org.apache.shiro.subject.PrincipalCollection)"><code>CachingRealm.clearCache(org.apache.shiro.subject.PrincipalCollection)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>doGetAuthenticationInfo</h4> |
| <pre class="methodSignature">protected abstract <a href="../authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a> <a href="../../../../src-html/org/apache/shiro/realm/AuthenticatingRealm.html#line.713">doGetAuthenticationInfo</a>​(<a href="../authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token) |
| throws <a href="../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="../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="../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> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/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" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2004–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |