| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <title>ModularRealmAuthenticator (Apache Shiro :: Core 1.10.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <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.5.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="ModularRealmAuthenticator (Apache Shiro :: Core 1.10.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance 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"><!-- Matomo --> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ /* We explicitly disable cookie tracking to avoid privacy issues */ _paq.push(['disableCookies']); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//matomo.privacy.apache.org/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '2']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Matomo Code --> |
| <!-- ========= 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/ModularRealmAuthenticator.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.authc.pam</a></div> |
| <h2 title="Class ModularRealmAuthenticator" class="title">Class ModularRealmAuthenticator</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="../AbstractAuthenticator.html" title="class in org.apache.shiro.authc">org.apache.shiro.authc.AbstractAuthenticator</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.shiro.authc.pam.ModularRealmAuthenticator</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="../Authenticator.html" title="interface in org.apache.shiro.authc">Authenticator</a></code>, <code><a href="../LogoutAware.html" title="interface in org.apache.shiro.authc">LogoutAware</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public class <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.64">ModularRealmAuthenticator</a> |
| extends <a href="../AbstractAuthenticator.html" title="class in org.apache.shiro.authc">AbstractAuthenticator</a></pre> |
| <div class="block">A <code>ModularRealmAuthenticator</code> delegates account lookups to a pluggable (modular) collection of |
| <a href="../../realm/Realm.html" title="interface in org.apache.shiro.realm"><code>Realm</code></a>s. This enables PAM (Pluggable Authentication Module) behavior in Shiro. |
| In addition to authorization duties, a Shiro Realm can also be thought of a PAM 'module'. |
| <p/> |
| Using this Authenticator allows you to "plug-in" your own |
| <code>Realm</code>s as you see fit. Common realms are those based on accessing |
| LDAP, relational databases, file systems, etc. |
| <p/> |
| If only one realm is configured (this is often the case for most applications), authentication success is naturally |
| only dependent upon invoking this one Realm's |
| <a href="../../realm/Realm.html#getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)"><code>Realm.getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)</code></a> method. |
| <p/> |
| But if two or more realms are configured, PAM behavior is implemented by iterating over the collection of realms |
| and interacting with each over the course of the authentication attempt. As this is more complicated, this |
| authenticator allows customized behavior for interpreting what happens when interacting with multiple realms - for |
| example, you might require all realms to be successful during the attempt, or perhaps only at least one must be |
| successful, or some other interpretation. This customized behavior can be performed via the use of a |
| <a href="#setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)"><code>AuthenticationStrategy</code></a>, which |
| you can inject as a property of this class. |
| <p/> |
| The strategy object provides callback methods that allow you to |
| determine what constitutes a success or failure in a multi-realm (PAM) scenario. And because this only makes sense |
| in a multi-realm scenario, the strategy object is only utilized when more than one Realm is configured. |
| <p/> |
| As most multi-realm applications require at least one Realm authenticates successfully, the default |
| implementation is the <a href="AtLeastOneSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AtLeastOneSuccessfulStrategy</code></a>.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.1</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#setRealms(java.util.Collection)"><code>setRealms(java.util.Collection<org.apache.shiro.realm.Realm>)</code></a>, |
| <a href="AtLeastOneSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AtLeastOneSuccessfulStrategy</code></a>, |
| <a href="AllSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AllSuccessfulStrategy</code></a>, |
| <a href="FirstSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>FirstSuccessfulStrategy</code></a></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()">ModularRealmAuthenticator</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Default no-argument constructor which |
| <a href="#setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)"><code>enables</code></a> an |
| <a href="AtLeastOneSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AtLeastOneSuccessfulStrategy</code></a> by default.</div> |
| </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="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="#assertRealmsConfigured()">assertRealmsConfigured</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doAuthenticate(org.apache.shiro.authc.AuthenticationToken)">doAuthenticate</a></span>​(<a href="../AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> authenticationToken)</code></th> |
| <td class="colLast"> |
| <div class="block">Attempts to authenticate the given token by iterating over the internal collection of |
| <a href="../../realm/Realm.html" title="interface in org.apache.shiro.realm"><code>Realm</code></a>s.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>protected <a href="../AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doMultiRealmAuthentication(java.util.Collection,org.apache.shiro.authc.AuthenticationToken)">doMultiRealmAuthentication</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><<a href="../../realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>> realms, |
| <a href="../AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</code></th> |
| <td class="colLast"> |
| <div class="block">Performs the multi-realm authentication attempt by calling back to a <a href="AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam"><code>AuthenticationStrategy</code></a> object |
| as each realm is consulted for <code>AuthenticationInfo</code> for the specified <code>token</code>.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doSingleRealmAuthentication(org.apache.shiro.realm.Realm,org.apache.shiro.authc.AuthenticationToken)">doSingleRealmAuthentication</a></span>​(<a href="../../realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a> realm, |
| <a href="../AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</code></th> |
| <td class="colLast"> |
| <div class="block">Performs the authentication attempt by interacting with the single configured realm, which is significantly |
| simpler than performing multi-realm logic.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code><a href="AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam">AuthenticationStrategy</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAuthenticationStrategy()">getAuthenticationStrategy</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the <code>AuthenticationStrategy</code> utilized by this modular authenticator during a multi-realm |
| log-in attempt.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><<a href="../../realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getRealms()">getRealms</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the realm(s) used by this <code>Authenticator</code> during an authentication attempt.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onLogout(org.apache.shiro.subject.PrincipalCollection)">onLogout</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">First calls <code>super.onLogout(principals)</code> to ensure a logout notification is issued, and for each |
| wrapped <code>Realm</code> that implements the <a href="../LogoutAware.html" title="interface in org.apache.shiro.authc"><code>LogoutAware</code></a> interface, calls |
| <code>((LogoutAware)realm).onLogout(principals)</code> to allow each realm the opportunity to perform |
| logout/cleanup operations during an user-logout.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)">setAuthenticationStrategy</a></span>​(<a href="AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam">AuthenticationStrategy</a> authenticationStrategy)</code></th> |
| <td class="colLast"> |
| <div class="block">Allows overriding the default <code>AuthenticationStrategy</code> utilized during multi-realm log-in attempts.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setRealms(java.util.Collection)">setRealms</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><<a href="../../realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>> realms)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets all realms used by this Authenticator, providing PAM (Pluggable Authentication Module) configuration.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.org.apache.shiro.authc.AbstractAuthenticator"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class org.apache.shiro.authc.<a href="../AbstractAuthenticator.html" title="class in org.apache.shiro.authc">AbstractAuthenticator</a></h3> |
| <code><a href="../AbstractAuthenticator.html#authenticate(org.apache.shiro.authc.AuthenticationToken)">authenticate</a>, <a href="../AbstractAuthenticator.html#getAuthenticationListeners()">getAuthenticationListeners</a>, <a href="../AbstractAuthenticator.html#notifyFailure(org.apache.shiro.authc.AuthenticationToken,org.apache.shiro.authc.AuthenticationException)">notifyFailure</a>, <a href="../AbstractAuthenticator.html#notifyLogout(org.apache.shiro.subject.PrincipalCollection)">notifyLogout</a>, <a href="../AbstractAuthenticator.html#notifySuccess(org.apache.shiro.authc.AuthenticationToken,org.apache.shiro.authc.AuthenticationInfo)">notifySuccess</a>, <a href="../AbstractAuthenticator.html#setAuthenticationListeners(java.util.Collection)">setAuthenticationListeners</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="blockListLast"> |
| <li class="blockList"> |
| <h4>ModularRealmAuthenticator</h4> |
| <pre>public <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.94">ModularRealmAuthenticator</a>()</pre> |
| <div class="block">Default no-argument constructor which |
| <a href="#setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)"><code>enables</code></a> an |
| <a href="AtLeastOneSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AtLeastOneSuccessfulStrategy</code></a> by default.</div> |
| </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="setRealms(java.util.Collection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setRealms</h4> |
| <pre class="methodSignature">public void <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.107">setRealms</a>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><<a href="../../realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>> realms)</pre> |
| <div class="block">Sets all realms used by this Authenticator, providing PAM (Pluggable Authentication Module) configuration.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>realms</code> - the realms to consult during authentication attempts.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getRealms()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getRealms</h4> |
| <pre class="methodSignature">protected <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><<a href="../../realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>> <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.116">getRealms</a>()</pre> |
| <div class="block">Returns the realm(s) used by this <code>Authenticator</code> during an authentication attempt.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the realm(s) used by this <code>Authenticator</code> during an authentication attempt.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getAuthenticationStrategy()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAuthenticationStrategy</h4> |
| <pre class="methodSignature">public <a href="AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam">AuthenticationStrategy</a> <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.131">getAuthenticationStrategy</a>()</pre> |
| <div class="block">Returns the <code>AuthenticationStrategy</code> utilized by this modular authenticator during a multi-realm |
| log-in attempt. This object is only used when two or more Realms are configured. |
| <p/> |
| Unless overridden by |
| the <a href="#setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)"><code>setAuthenticationStrategy(AuthenticationStrategy)</code></a> method, the default implementation |
| is the <a href="AtLeastOneSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AtLeastOneSuccessfulStrategy</code></a>.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the <code>AuthenticationStrategy</code> utilized by this modular authenticator during a log-in attempt.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.2</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAuthenticationStrategy</h4> |
| <pre class="methodSignature">public void <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.142">setAuthenticationStrategy</a>​(<a href="AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam">AuthenticationStrategy</a> authenticationStrategy)</pre> |
| <div class="block">Allows overriding the default <code>AuthenticationStrategy</code> utilized during multi-realm log-in attempts. |
| This object is only used when two or more Realms are configured.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>authenticationStrategy</code> - the strategy implementation to use during log-in attempts.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.2</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="assertRealmsConfigured()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>assertRealmsConfigured</h4> |
| <pre class="methodSignature">protected void <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.156">assertRealmsConfigured</a>() |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalStateException</a></pre> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalStateException</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="doSingleRealmAuthentication(org.apache.shiro.realm.Realm,org.apache.shiro.authc.AuthenticationToken)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>doSingleRealmAuthentication</h4> |
| <pre class="methodSignature">protected <a href="../AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a> <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.173">doSingleRealmAuthentication</a>​(<a href="../../realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a> realm, |
| <a href="../AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</pre> |
| <div class="block">Performs the authentication attempt by interacting with the single configured realm, which is significantly |
| simpler than performing multi-realm logic.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>realm</code> - the realm to consult for AuthenticationInfo.</dd> |
| <dd><code>token</code> - the submitted AuthenticationToken representing the subject's (user's) log-in principals and credentials.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the AuthenticationInfo associated with the user account corresponding to the specified <code>token</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="doMultiRealmAuthentication(java.util.Collection,org.apache.shiro.authc.AuthenticationToken)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>doMultiRealmAuthentication</h4> |
| <pre class="methodSignature">protected <a href="../AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a> <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.198">doMultiRealmAuthentication</a>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><<a href="../../realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>> realms, |
| <a href="../AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</pre> |
| <div class="block">Performs the multi-realm authentication attempt by calling back to a <a href="AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam"><code>AuthenticationStrategy</code></a> object |
| as each realm is consulted for <code>AuthenticationInfo</code> for the specified <code>token</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>realms</code> - the multiple realms configured on this Authenticator instance.</dd> |
| <dd><code>token</code> - the submitted AuthenticationToken representing the subject's (user's) log-in principals and credentials.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an aggregated AuthenticationInfo instance representing account data across all the successfully |
| consulted realms.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="doAuthenticate(org.apache.shiro.authc.AuthenticationToken)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>doAuthenticate</h4> |
| <pre class="methodSignature">protected <a href="../AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a> <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.269">doAuthenticate</a>​(<a href="../AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> authenticationToken) |
| throws <a href="../AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</a></pre> |
| <div class="block">Attempts to authenticate the given token by iterating over the internal collection of |
| <a href="../../realm/Realm.html" title="interface in org.apache.shiro.realm"><code>Realm</code></a>s. For each realm, first the <a href="../../realm/Realm.html#supports(org.apache.shiro.authc.AuthenticationToken)"><code>Realm.supports(org.apache.shiro.authc.AuthenticationToken)</code></a> |
| method will be called to determine if the realm supports the <code>authenticationToken</code> method argument. |
| <p/> |
| If a realm does support |
| the token, its <a href="../../realm/Realm.html#getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)"><code>Realm.getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)</code></a> |
| method will be called. If the realm returns a non-null account, the token will be |
| considered authenticated for that realm and the account data recorded. If the realm returns <code>null</code>, |
| the next realm will be consulted. If no realms support the token or all supporting realms return null, |
| an <a href="../AuthenticationException.html" title="class in org.apache.shiro.authc"><code>AuthenticationException</code></a> will be thrown to indicate that the user could not be authenticated. |
| <p/> |
| After all realms have been consulted, the information from each realm is aggregated into a single |
| <a href="../AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> object and returned.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../AbstractAuthenticator.html#doAuthenticate(org.apache.shiro.authc.AuthenticationToken)">doAuthenticate</a></code> in class <code><a href="../AbstractAuthenticator.html" title="class in org.apache.shiro.authc">AbstractAuthenticator</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>authenticationToken</code> - the token containing the authentication principal and credentials for the |
| user being authenticated.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>account information attributed to the authenticated user.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalStateException</a></code> - if no realms have been configured at the time this method is invoked</dd> |
| <dd><code><a href="../AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</a></code> - if the user could not be authenticated or the user is denied authentication |
| for the given principal and credentials.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="onLogout(org.apache.shiro.subject.PrincipalCollection)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>onLogout</h4> |
| <pre class="methodSignature">public void <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.290">onLogout</a>​(<a href="../../subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</pre> |
| <div class="block">First calls <code>super.onLogout(principals)</code> to ensure a logout notification is issued, and for each |
| wrapped <code>Realm</code> that implements the <a href="../LogoutAware.html" title="interface in org.apache.shiro.authc"><code>LogoutAware</code></a> interface, calls |
| <code>((LogoutAware)realm).onLogout(principals)</code> to allow each realm the opportunity to perform |
| logout/cleanup operations during an user-logout. |
| <p/> |
| Shiro's Realm implementations all implement the <code>LogoutAware</code> interface by default and can be |
| overridden for realm-specific logout logic.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../LogoutAware.html#onLogout(org.apache.shiro.subject.PrincipalCollection)">onLogout</a></code> in interface <code><a href="../LogoutAware.html" title="interface in org.apache.shiro.authc">LogoutAware</a></code></dd> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="../AbstractAuthenticator.html#onLogout(org.apache.shiro.subject.PrincipalCollection)">onLogout</a></code> in class <code><a href="../AbstractAuthenticator.html" title="class in org.apache.shiro.authc">AbstractAuthenticator</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>principals</code> - the application-specific Subject/user identifier.</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/ModularRealmAuthenticator.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–2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |