blob: efc679bee02ac761da6018497fc31e44f39202ca [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_65) on Tue Feb 25 18:15:46 EST 2014 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
ModularRealmAuthenticator (Apache Shiro 1.2.3 API)
</TITLE>
<META NAME="date" CONTENT="2014-02-25">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ModularRealmAuthenticator (Apache Shiro 1.2.3 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ModularRealmAuthenticator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/shiro/authc/pam/FirstSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/shiro/authc/pam/UnsupportedTokenException.html" title="class in org.apache.shiro.authc.pam"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/shiro/authc/pam/ModularRealmAuthenticator.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ModularRealmAuthenticator.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.shiro.authc.pam</FONT>
<BR>
Class ModularRealmAuthenticator</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html" title="class in org.apache.shiro.authc">org.apache.shiro.authc.AbstractAuthenticator</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.shiro.authc.pam.ModularRealmAuthenticator</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <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>
<DL>
<DT><PRE>public class <A HREF="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.64"><B>ModularRealmAuthenticator</B></A><DT>extends <A HREF="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html" title="class in org.apache.shiro.authc">AbstractAuthenticator</A></DL>
</PRE>
<P>
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 &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 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>.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>0.1</DD>
<DT><B>See Also:</B><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></DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#ModularRealmAuthenticator()">ModularRealmAuthenticator</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#assertRealmsConfigured()">assertRealmsConfigured</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#doAuthenticate(org.apache.shiro.authc.AuthenticationToken)">doAuthenticate</A></B>(<A HREF="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;authenticationToken)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#doMultiRealmAuthentication(java.util.Collection, org.apache.shiro.authc.AuthenticationToken)">doMultiRealmAuthentication</A></B>(<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>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#doSingleRealmAuthentication(org.apache.shiro.realm.Realm, org.apache.shiro.authc.AuthenticationToken)">doSingleRealmAuthentication</A></B>(<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>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Performs the authentication attempt by interacting with the single configured realm, which is significantly
simpler than performing multi-realm logic.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/shiro/authc/pam/AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam">AuthenticationStrategy</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#getAuthenticationStrategy()">getAuthenticationStrategy</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>AuthenticationStrategy</code> utilized by this modular authenticator during a multi-realm
log-in attempt.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/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></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#getRealms()">getRealms</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the realm(s) used by this <code>Authenticator</code> during an authentication attempt.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#onLogout(org.apache.shiro.subject.PrincipalCollection)">onLogout</A></B>(<A HREF="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</A>&nbsp;principals)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)">setAuthenticationStrategy</A></B>(<A HREF="../../../../../org/apache/shiro/authc/pam/AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam">AuthenticationStrategy</A>&nbsp;authenticationStrategy)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allows overriding the default <code>AuthenticationStrategy</code> utilized during multi-realm log-in attempts.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#setRealms(java.util.Collection)">setRealms</A></B>(<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>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets all realms used by this Authenticator, providing PAM (Pluggable Authentication Module) configuration.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.shiro.authc.AbstractAuthenticator"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.shiro.authc.<A HREF="../../../../../org/apache/shiro/authc/AbstractAuthenticator.html" title="class in org.apache.shiro.authc">AbstractAuthenticator</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><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></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="ModularRealmAuthenticator()"><!-- --></A><H3>
ModularRealmAuthenticator</H3>
<PRE>
public <A HREF="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.94"><B>ModularRealmAuthenticator</B></A>()</PRE>
<DL>
<DD>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.
<P>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="setRealms(java.util.Collection)"><!-- --></A><H3>
setRealms</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.107"><B>setRealms</B></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>
<DL>
<DD>Sets all realms used by this Authenticator, providing PAM (Pluggable Authentication Module) configuration.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>realms</CODE> - the realms to consult during authentication attempts.</DL>
</DD>
</DL>
<HR>
<A NAME="getRealms()"><!-- --></A><H3>
getRealms</H3>
<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>&lt;<A HREF="../../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</A>&gt; <A HREF="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.116"><B>getRealms</B></A>()</PRE>
<DL>
<DD>Returns the realm(s) used by this <code>Authenticator</code> during an authentication attempt.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the realm(s) used by this <code>Authenticator</code> during an authentication attempt.</DL>
</DD>
</DL>
<HR>
<A NAME="getAuthenticationStrategy()"><!-- --></A><H3>
getAuthenticationStrategy</H3>
<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"><B>getAuthenticationStrategy</B></A>()</PRE>
<DL>
<DD>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>.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the <code>AuthenticationStrategy</code> utilized by this modular authenticator during a log-in attempt.<DT><B>Since:</B></DT>
<DD>0.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="setAuthenticationStrategy(org.apache.shiro.authc.pam.AuthenticationStrategy)"><!-- --></A><H3>
setAuthenticationStrategy</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.142"><B>setAuthenticationStrategy</B></A>(<A HREF="../../../../../org/apache/shiro/authc/pam/AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam">AuthenticationStrategy</A>&nbsp;authenticationStrategy)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>authenticationStrategy</CODE> - the strategy implementation to use during log-in attempts.<DT><B>Since:</B></DT>
<DD>0.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="assertRealmsConfigured()"><!-- --></A><H3>
assertRealmsConfigured</H3>
<PRE>
protected void <A HREF="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.156"><B>assertRealmsConfigured</B></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>
<DD><DL>
<DT><B>Throws:</B>
<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></DL>
</DD>
</DL>
<HR>
<A NAME="doSingleRealmAuthentication(org.apache.shiro.realm.Realm, org.apache.shiro.authc.AuthenticationToken)"><!-- --></A><H3>
doSingleRealmAuthentication</H3>
<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"><B>doSingleRealmAuthentication</B></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>
<DL>
<DD>Performs the authentication attempt by interacting with the single configured realm, which is significantly
simpler than performing multi-realm logic.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>realm</CODE> - the realm to consult for AuthenticationInfo.<DD><CODE>token</CODE> - the submitted AuthenticationToken representing the subject's (user's) log-in principals and credentials.
<DT><B>Returns:</B><DD>the AuthenticationInfo associated with the user account corresponding to the specified <code>token</code></DL>
</DD>
</DL>
<HR>
<A NAME="doMultiRealmAuthentication(java.util.Collection, org.apache.shiro.authc.AuthenticationToken)"><!-- --></A><H3>
doMultiRealmAuthentication</H3>
<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"><B>doMultiRealmAuthentication</B></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>
<DL>
<DD>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>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>realms</CODE> - the multiple realms configured on this Authenticator instance.<DD><CODE>token</CODE> - the submitted AuthenticationToken representing the subject's (user's) log-in principals and credentials.
<DT><B>Returns:</B><DD>an aggregated AuthenticationInfo instance representing account data across all the successfully
consulted realms.</DL>
</DD>
</DL>
<HR>
<A NAME="doAuthenticate(org.apache.shiro.authc.AuthenticationToken)"><!-- --></A><H3>
doAuthenticate</H3>
<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"><B>doAuthenticate</B></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>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Specified by:</B><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></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>authenticationToken</CODE> - the token containing the authentication principal and credentials for the
user being authenticated.
<DT><B>Returns:</B><DD>account information attributed to the authenticated user.
<DT><B>Throws:</B>
<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><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.</DL>
</DD>
</DL>
<HR>
<A NAME="onLogout(org.apache.shiro.subject.PrincipalCollection)"><!-- --></A><H3>
onLogout</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/authc/pam/ModularRealmAuthenticator.html#line.284"><B>onLogout</B></A>(<A HREF="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</A>&nbsp;principals)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Specified by:</B><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><DT><B>Overrides:</B><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></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>principals</CODE> - the application-specific Subject/user identifier.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ModularRealmAuthenticator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/shiro/authc/pam/FirstSuccessfulStrategy.html" title="class in org.apache.shiro.authc.pam"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/shiro/authc/pam/UnsupportedTokenException.html" title="class in org.apache.shiro.authc.pam"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/shiro/authc/pam/ModularRealmAuthenticator.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ModularRealmAuthenticator.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2004-2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>