blob: c25e89a0457862b6a169ba70923b5613f71a4e78 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="fr">
<head>
<!-- Generated by javadoc (1.8.0_77) on Sun May 14 11:51:26 CEST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ModularRealmAuthenticator (Apache Shiro 1.4.0 API)</title>
<meta name="date" content="2017-05-14">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ModularRealmAuthenticator (Apache Shiro 1.4.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"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";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/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="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/shiro/authc/pam/UnsupportedTokenException.html" title="class in org.apache.shiro.authc.pam"><span class="typeNameLink">Next&nbsp;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&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.shiro.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> delegates 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 &quot;plug-in&quot; 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 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="../../../../../org/apache/shiro/authc/pam/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="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#setRealms-java.util.Collection-"><code>setRealms(java.util.Collection&lt;org.apache.shiro.realm.Realm&gt;)</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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#ModularRealmAuthenticator--">ModularRealmAuthenticator</a></span>()</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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#assertRealmsConfigured--">assertRealmsConfigured</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i1" 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><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#doAuthenticate-org.apache.shiro.authc.AuthenticationToken-">doAuthenticate</a></span>(<a href="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;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 id="i2" 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><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#doMultiRealmAuthentication-java.util.Collection-org.apache.shiro.authc.AuthenticationToken-">doMultiRealmAuthentication</a></span>(<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>&lt;<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>&gt;&nbsp;realms,
<a href="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;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 id="i3" 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><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#doSingleRealmAuthentication-org.apache.shiro.realm.Realm-org.apache.shiro.authc.AuthenticationToken-">doSingleRealmAuthentication</a></span>(<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>&nbsp;realm,
<a href="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;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 id="i4" 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><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#getAuthenticationStrategy--">getAuthenticationStrategy</a></span>()</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 id="i5" 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>&lt;<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#getRealms--">getRealms</a></span>()</code>
<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>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#onLogout-org.apache.shiro.subject.PrincipalCollection-">onLogout</a></span>(<a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a>&nbsp;principals)</code>
<div class="block">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 id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#setAuthenticationStrategy-org.apache.shiro.authc.pam.AuthenticationStrategy-">setAuthenticationStrategy</a></span>(<a href="../../../../../org/apache/shiro/authc/pam/AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam">AuthenticationStrategy</a>&nbsp;authenticationStrategy)</code>
<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>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#setRealms-java.util.Collection-">setRealms</a></span>(<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>&lt;<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>&gt;&nbsp;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&nbsp;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&nbsp;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&nbsp;<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&nbsp;void&nbsp;<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>&lt;<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>&gt;&nbsp;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 name="getRealms--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRealms</h4>
<pre>protected&nbsp;<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>&lt;<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>&gt;&nbsp;<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 name="getAuthenticationStrategy--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAuthenticationStrategy</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/shiro/authc/pam/AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam">AuthenticationStrategy</a>&nbsp;<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="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 name="setAuthenticationStrategy-org.apache.shiro.authc.pam.AuthenticationStrategy-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAuthenticationStrategy</h4>
<pre>public&nbsp;void&nbsp;<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>&nbsp;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 name="assertRealmsConfigured--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assertRealmsConfigured</h4>
<pre>protected&nbsp;void&nbsp;<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="throwsLabel">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&nbsp;<a href="../../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;<a href="../../../../../src-html/org/apache/shiro/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>&nbsp;realm,
<a href="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;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 name="doMultiRealmAuthentication-java.util.Collection-org.apache.shiro.authc.AuthenticationToken-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doMultiRealmAuthentication</h4>
<pre>protected&nbsp;<a href="../../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;<a href="../../../../../src-html/org/apache/shiro/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>&lt;<a href="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>&gt;&nbsp;realms,
<a href="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;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="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 name="doAuthenticate-org.apache.shiro.authc.AuthenticationToken-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doAuthenticate</h4>
<pre>protected&nbsp;<a href="../../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;<a href="../../../../../src-html/org/apache/shiro/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>&nbsp;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><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html#doAuthenticate-org.apache.shiro.authc.AuthenticationToken-">doAuthenticate</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/shiro/authc/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="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&nbsp;void&nbsp;<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>&nbsp;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><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/shiro/authc/LogoutAware.html#onLogout-org.apache.shiro.subject.PrincipalCollection-">onLogout</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/shiro/authc/LogoutAware.html" title="interface in org.apache.shiro.authc">LogoutAware</a></code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html#onLogout-org.apache.shiro.subject.PrincipalCollection-">onLogout</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/shiro/authc/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>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/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="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/shiro/authc/pam/UnsupportedTokenException.html" title="class in org.apache.shiro.authc.pam"><span class="typeNameLink">Next&nbsp;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&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2004&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>