| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (version 1.7.0_21) on Thu May 30 14:51:23 PDT 2013 --> |
| <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> |
| <title>ModularRealmAuthenticator (Apache Shiro 1.2.1 API)</title> |
| <meta name="date" content="2013-05-30"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="ModularRealmAuthenticator (Apache Shiro 1.2.1 API)"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar_top"> |
| <!-- --> |
| </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/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"> |
| <li><a href="../../../../../org/apache/shiro/authc/pam/FirstSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/shiro/authc/pam/UnsupportedTokenException.html" title="class in org.apache.shiro.authc.pam"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/shiro/authc/pam/ModularRealmAuthenticator.html" target="_top">Frames</a></li> |
| <li><a href="ModularRealmAuthenticator.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </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 name="skip-navbar_top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.shiro.authc.pam</div> |
| <h2 title="Class ModularRealmAuthenticator" class="title">Class ModularRealmAuthenticator</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="../../../../../org/apache/shiro/authc/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><a href="../../../../../org/apache/shiro/authc/Authenticator.html" title="interface in org.apache.shiro.authc">Authenticator</a>, <a href="../../../../../org/apache/shiro/authc/LogoutAware.html" title="interface in org.apache.shiro.authc">LogoutAware</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public class <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.64">ModularRealmAuthenticator</a> |
| extends <a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html" title="class in org.apache.shiro.authc">AbstractAuthenticator</a></pre> |
| <div class="block">A <code>ModularRealmAuthenticator</code> delgates account lookups to a pluggable (modular) collection of |
| <a href="../../../../../org/apache/shiro/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="../../../../../org/apache/shiro/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="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#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 mult-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="../../../../../org/apache/shiro/authc/pam/AtLeastOneSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AtLeastOneSuccessfulStrategy</code></a>.</div> |
| <dl><dt><span class="strong">Since:</span></dt> |
| <dd>0.1</dd> |
| <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#setRealms(java.util.Collection)"><code>setRealms(java.util.Collection<org.apache.shiro.realm.Realm>)</code></a>, |
| <a href="../../../../../org/apache/shiro/authc/pam/AtLeastOneSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AtLeastOneSuccessfulStrategy</code></a>, |
| <a href="../../../../../org/apache/shiro/authc/pam/AllSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AllSuccessfulStrategy</code></a>, |
| <a href="../../../../../org/apache/shiro/authc/pam/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 ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><strong><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#ModularRealmAuthenticator()">ModularRealmAuthenticator</a></strong>()</code> |
| <div class="block">Default no-argument constructor which |
| <a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)"><code>enables</code></a> an |
| <a href="../../../../../org/apache/shiro/authc/pam/AtLeastOneSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AtLeastOneSuccessfulStrategy</code></a> by default.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span>Methods</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#assertRealmsConfigured()">assertRealmsConfigured</a></strong>()</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#doAuthenticate(org.apache.shiro.authc.AuthenticationToken)">doAuthenticate</a></strong>(<a href="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> authenticationToken)</code> |
| <div class="block">Attempts to authenticate the given token by iterating over the internal collection of |
| <a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm"><code>Realm</code></a>s.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#doMultiRealmAuthentication(java.util.Collection, org.apache.shiro.authc.AuthenticationToken)">doMultiRealmAuthentication</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>> realms, |
| <a href="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</code> |
| <div class="block">Performs the multi-realm authentication attempt by calling back to a <a href="../../../../../org/apache/shiro/authc/pam/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 class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#doSingleRealmAuthentication(org.apache.shiro.realm.Realm, org.apache.shiro.authc.AuthenticationToken)">doSingleRealmAuthentication</a></strong>(<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a> realm, |
| <a href="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</code> |
| <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 class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/shiro/authc/pam/AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam">AuthenticationStrategy</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#getAuthenticationStrategy()">getAuthenticationStrategy</a></strong>()</code> |
| <div class="block">Returns the <code>AuthenticationStrategy</code> utilized by this modular authenticator during a multi-realm |
| log-in attempt.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected <a href="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#getRealms()">getRealms</a></strong>()</code> |
| <div class="block">Returns the realm(s) used by this <code>Authenticator</code> during an authentication attempt.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#onLogout(org.apache.shiro.subject.PrincipalCollection)">onLogout</a></strong>(<a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</code> |
| <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="../../../../../org/apache/shiro/authc/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 class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)">setAuthenticationStrategy</a></strong>(<a href="../../../../../org/apache/shiro/authc/pam/AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam">AuthenticationStrategy</a> authenticationStrategy)</code> |
| <div class="block">Allows overriding the default <code>AuthenticationStrategy</code> utilized during multi-realm log-in attempts.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#setRealms(java.util.Collection)">setRealms</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>> realms)</code> |
| <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 name="methods_inherited_from_class_org.apache.shiro.authc.AbstractAuthenticator"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class org.apache.shiro.authc.<a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html" title="class in org.apache.shiro.authc">AbstractAuthenticator</a></h3> |
| <code><a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html#authenticate(org.apache.shiro.authc.AuthenticationToken)">authenticate</a>, <a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html#getAuthenticationListeners()">getAuthenticationListeners</a>, <a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html#notifyFailure(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationException)">notifyFailure</a>, <a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html#notifyLogout(org.apache.shiro.subject.PrincipalCollection)">notifyLogout</a>, <a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html#notifySuccess(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)">notifySuccess</a>, <a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html#setAuthenticationListeners(java.util.Collection)">setAuthenticationListeners</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="ModularRealmAuthenticator()"> |
| <!-- --> |
| </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="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)"><code>enables</code></a> an |
| <a href="../../../../../org/apache/shiro/authc/pam/AtLeastOneSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AtLeastOneSuccessfulStrategy</code></a> by default.</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="setRealms(java.util.Collection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setRealms</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.107">setRealms</a>(<a href="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../../org/apache/shiro/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="strong">Parameters:</span></dt><dd><code>realms</code> - the realms to consult during authentication attempts.</dd></dl> |
| </li> |
| </ul> |
| <a name="getRealms()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getRealms</h4> |
| <pre>protected <a href="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../../org/apache/shiro/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="strong">Returns:</span></dt><dd>the realm(s) used by this <code>Authenticator</code> during an authentication attempt.</dd></dl> |
| </li> |
| </ul> |
| <a name="getAuthenticationStrategy()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAuthenticationStrategy</h4> |
| <pre>public <a href="../../../../../org/apache/shiro/authc/pam/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="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)"><code>setAuthenticationStrategy(AuthenticationStrategy)</code></a> method, the default implementation |
| is the <a href="../../../../../org/apache/shiro/authc/pam/AtLeastOneSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><code>AtLeastOneSuccessfulStrategy</code></a>.</div> |
| <dl><dt><span class="strong">Returns:</span></dt><dd>the <code>AuthenticationStrategy</code> utilized by this modular authenticator during a log-in attempt.</dd><dt><span class="strong">Since:</span></dt> |
| <dd>0.2</dd></dl> |
| </li> |
| </ul> |
| <a name="setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAuthenticationStrategy</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.142">setAuthenticationStrategy</a>(<a href="../../../../../org/apache/shiro/authc/pam/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="strong">Parameters:</span></dt><dd><code>authenticationStrategy</code> - the strategy implementation to use during log-in attempts.</dd><dt><span class="strong">Since:</span></dt> |
| <dd>0.2</dd></dl> |
| </li> |
| </ul> |
| <a name="assertRealmsConfigured()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>assertRealmsConfigured</h4> |
| <pre>protected void <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.156">assertRealmsConfigured</a>() |
| throws <a href="http://java.sun.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></pre> |
| <dl><dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code></dd></dl> |
| </li> |
| </ul> |
| <a name="doSingleRealmAuthentication(org.apache.shiro.realm.Realm, org.apache.shiro.authc.AuthenticationToken)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>doSingleRealmAuthentication</h4> |
| <pre>protected <a href="../../../../../org/apache/shiro/authc/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="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a> realm, |
| <a href="../../../../../org/apache/shiro/authc/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="strong">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="strong">Returns:</span></dt><dd>the AuthenticationInfo associated with the user account corresponding to the specified <code>token</code></dd></dl> |
| </li> |
| </ul> |
| <a name="doMultiRealmAuthentication(java.util.Collection, org.apache.shiro.authc.AuthenticationToken)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>doMultiRealmAuthentication</h4> |
| <pre>protected <a href="../../../../../org/apache/shiro/authc/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="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>> realms, |
| <a href="../../../../../org/apache/shiro/authc/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="../../../../../org/apache/shiro/authc/pam/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="strong">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="strong">Returns:</span></dt><dd>an aggregated AuthenticationInfo instance representing account data across all the successfully |
| consulted realms.</dd></dl> |
| </li> |
| </ul> |
| <a name="doAuthenticate(org.apache.shiro.authc.AuthenticationToken)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>doAuthenticate</h4> |
| <pre>protected <a href="../../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a> <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.263">doAuthenticate</a>(<a href="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> authenticationToken) |
| throws <a href="../../../../../org/apache/shiro/authc/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="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm"><code>Realm</code></a>s. For each realm, first the <a href="../../../../../org/apache/shiro/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="../../../../../org/apache/shiro/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="../../../../../org/apache/shiro/authc/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="../../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><code>AuthenticationInfo</code></a> object and returned.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html#doAuthenticate(org.apache.shiro.authc.AuthenticationToken)">doAuthenticate</a></code> in class <code><a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html" title="class in org.apache.shiro.authc">AbstractAuthenticator</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>authenticationToken</code> - the token containing the authentication principal and credentials for the |
| user being authenticated.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>account information attributed to the authenticated user.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if no realms have been configured at the time this method is invoked</dd> |
| <dd><code><a href="../../../../../org/apache/shiro/authc/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 name="onLogout(org.apache.shiro.subject.PrincipalCollection)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>onLogout</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.284">onLogout</a>(<a href="../../../../../org/apache/shiro/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="../../../../../org/apache/shiro/authc/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><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authc/LogoutAware.html#onLogout(org.apache.shiro.subject.PrincipalCollection)">onLogout</a></code> in interface <code><a href="../../../../../org/apache/shiro/authc/LogoutAware.html" title="interface in org.apache.shiro.authc">LogoutAware</a></code></dd> |
| <dt><strong>Overrides:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html#onLogout(org.apache.shiro.subject.PrincipalCollection)">onLogout</a></code> in class <code><a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html" title="class in org.apache.shiro.authc">AbstractAuthenticator</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>principals</code> - the application-specific Subject/user identifier.</dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar_bottom"> |
| <!-- --> |
| </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/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"> |
| <li><a href="../../../../../org/apache/shiro/authc/pam/FirstSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/shiro/authc/pam/UnsupportedTokenException.html" title="class in org.apache.shiro.authc.pam"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/shiro/authc/pam/ModularRealmAuthenticator.html" target="_top">Frames</a></li> |
| <li><a href="ModularRealmAuthenticator.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses-noframe.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> |
| </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 name="skip-navbar_bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2004-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p> |
| </body> |
| </html> |
| |