blob: ef78db6bb4288294f69339933cfcfcae05fdb4cf [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 Fri Mar 04 17:58:54 EST 2016 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
AbstractAuthenticator (Apache Shiro 1.2.4 API)
</TITLE>
<META NAME="date" CONTENT="2016-03-04">
<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="AbstractAuthenticator (Apache Shiro 1.2.4 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/AbstractAuthenticator.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;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/authc/Account.html" title="interface in org.apache.shiro.authc"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/shiro/authc/AbstractAuthenticator.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AbstractAuthenticator.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</FONT>
<BR>
Class AbstractAuthenticator</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 "><B>org.apache.shiro.authc.AbstractAuthenticator</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>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../org/apache/shiro/authc/pam/ModularRealmAuthenticator.html" title="class in org.apache.shiro.authc.pam">ModularRealmAuthenticator</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public abstract class <A HREF="../../../../src-html/org/apache/shiro/authc/AbstractAuthenticator.html#line.43"><B>AbstractAuthenticator</B></A><DT>extends <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><DT>implements <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></DL>
</PRE>
<P>
Superclass for almost all <A HREF="../../../../org/apache/shiro/authc/Authenticator.html" title="interface in org.apache.shiro.authc"><CODE>Authenticator</CODE></A> implementations that performs the common work around authentication
attempts.
<p/>
This class delegates the actual authentication attempt to subclasses but supports notification for
successful and failed logins as well as logouts. Notification is sent to one or more registered
<A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s to allow for custom processing logic
when these conditions occur.
<p/>
In most cases, the only thing a subclass needs to do (via its <A HREF="../../../../org/apache/shiro/authc/AbstractAuthenticator.html#doAuthenticate(org.apache.shiro.authc.AuthenticationToken)"><CODE>doAuthenticate(org.apache.shiro.authc.AuthenticationToken)</CODE></A> implementation)
is perform the actual principal/credential verification process for the submitted <code>AuthenticationToken</code>.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>0.1</DD>
</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/AbstractAuthenticator.html#AbstractAuthenticator()">AbstractAuthenticator</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default no-argument constructor.</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>&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/AbstractAuthenticator.html#authenticate(org.apache.shiro.authc.AuthenticationToken)">authenticate</A></B>(<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;Implementation of the <A HREF="../../../../org/apache/shiro/authc/Authenticator.html" title="interface in org.apache.shiro.authc"><CODE>Authenticator</CODE></A> interface that functions in the following manner:
Calls template <A HREF="../../../../org/apache/shiro/authc/AbstractAuthenticator.html#doAuthenticate(org.apache.shiro.authc.AuthenticationToken)"><CODE>doAuthenticate</CODE></A> method for subclass execution of the actual
authentication behavior.
If an <code>AuthenticationException</code> is thrown during <code>doAuthenticate</code>,
<A HREF="../../../../org/apache/shiro/authc/AbstractAuthenticator.html#notifyFailure(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationException)"><CODE>notify</CODE></A> any registered
<A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s of the exception and then propogate the exception
for the caller to handle.
If no exception is thrown (indicating a successful login),
<A HREF="../../../../org/apache/shiro/authc/AbstractAuthenticator.html#notifySuccess(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)"><CODE>notify</CODE></A> any registered
<A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s of the successful attempt.
Return the <code>AuthenticationInfo</code>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected abstract &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/AbstractAuthenticator.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;token)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Template design pattern hook for subclasses to implement specific authentication behavior.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&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/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc">AuthenticationListener</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/authc/AbstractAuthenticator.html#getAuthenticationListeners()">getAuthenticationListeners</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s that should be notified during authentication
attempts.</TD>
</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/AbstractAuthenticator.html#notifyFailure(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationException)">notifyFailure</A></B>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token,
<A HREF="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</A>&nbsp;ae)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Notifies any registered <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s that
authentication failed for the
specified <code>token</code> which resulted in the specified <code>ae</code> exception.</TD>
</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/AbstractAuthenticator.html#notifyLogout(org.apache.shiro.subject.PrincipalCollection)">notifyLogout</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;Notifies any registered <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s that a
<code>Subject</code> has logged-out.</TD>
</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/AbstractAuthenticator.html#notifySuccess(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)">notifySuccess</A></B>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token,
<A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</A>&nbsp;info)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Notifies any registered <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s that
authentication was successful for the specified <code>token</code> which resulted in the specified
<code>info</code>.</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/AbstractAuthenticator.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;This implementation merely calls
<A HREF="../../../../org/apache/shiro/authc/AbstractAuthenticator.html#notifyLogout(org.apache.shiro.subject.PrincipalCollection)"><CODE>notifyLogout</CODE></A> to allow any registered listeners
to react to the 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/AbstractAuthenticator.html#setAuthenticationListeners(java.util.Collection)">setAuthenticationListeners</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/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc">AuthenticationListener</A>&gt;&nbsp;listeners)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s that should be notified during authentication
attempts.</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="AbstractAuthenticator()"><!-- --></A><H3>
AbstractAuthenticator</H3>
<PRE>
public <A HREF="../../../../src-html/org/apache/shiro/authc/AbstractAuthenticator.html#line.69"><B>AbstractAuthenticator</B></A>()</PRE>
<DL>
<DD>Default no-argument constructor. Ensures the internal
<A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A> collection is a non-null <code>ArrayList</code>.
<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="setAuthenticationListeners(java.util.Collection)"><!-- --></A><H3>
setAuthenticationListeners</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/authc/AbstractAuthenticator.html#line.85"><B>setAuthenticationListeners</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/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc">AuthenticationListener</A>&gt;&nbsp;listeners)</PRE>
<DL>
<DD>Sets the <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s that should be notified during authentication
attempts.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>listeners</CODE> - one or more <code>AuthenticationListener</code>s that should be notified due to an
authentication attempt.</DL>
</DD>
</DL>
<HR>
<A NAME="getAuthenticationListeners()"><!-- --></A><H3>
getAuthenticationListeners</H3>
<PRE>
public <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/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc">AuthenticationListener</A>&gt; <A HREF="../../../../src-html/org/apache/shiro/authc/AbstractAuthenticator.html#line.101"><B>getAuthenticationListeners</B></A>()</PRE>
<DL>
<DD>Returns the <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s that should be notified during authentication
attempts.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s that should be notified during authentication
attempts.</DL>
</DD>
</DL>
<HR>
<A NAME="notifySuccess(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)"><!-- --></A><H3>
notifySuccess</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/authc/AbstractAuthenticator.html#line.119"><B>notifySuccess</B></A>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token,
<A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</A>&nbsp;info)</PRE>
<DL>
<DD>Notifies any registered <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s that
authentication was successful for the specified <code>token</code> which resulted in the specified
<code>info</code>. This implementation merely iterates over the internal <code>listeners</code> collection and
calls <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html#onSuccess(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)"><CODE>onSuccess</CODE></A>
for each.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>token</CODE> - the submitted <code>AuthenticationToken</code> that resulted in a successful authentication.<DD><CODE>info</CODE> - the returned <code>AuthenticationInfo</code> resulting from the successful authentication.</DL>
</DD>
</DL>
<HR>
<A NAME="notifyFailure(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationException)"><!-- --></A><H3>
notifyFailure</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/authc/AbstractAuthenticator.html#line.136"><B>notifyFailure</B></A>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token,
<A HREF="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</A>&nbsp;ae)</PRE>
<DL>
<DD>Notifies any registered <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s that
authentication failed for the
specified <code>token</code> which resulted in the specified <code>ae</code> exception. This implementation merely
iterates over the internal <code>listeners</code> collection and calls
<A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html#onFailure(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationException)"><CODE>onFailure</CODE></A>
for each.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>token</CODE> - the submitted <code>AuthenticationToken</code> that resulted in a failed authentication.<DD><CODE>ae</CODE> - the resulting <code>AuthenticationException</code> that caused the authentication to fail.</DL>
</DD>
</DL>
<HR>
<A NAME="notifyLogout(org.apache.shiro.subject.PrincipalCollection)"><!-- --></A><H3>
notifyLogout</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/authc/AbstractAuthenticator.html#line.151"><B>notifyLogout</B></A>(<A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</A>&nbsp;principals)</PRE>
<DL>
<DD>Notifies any registered <A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s that a
<code>Subject</code> has logged-out. This implementation merely
iterates over the internal <code>listeners</code> collection and calls
<A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html#onLogout(org.apache.shiro.subject.PrincipalCollection)"><CODE>onLogout</CODE></A>
for each.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>principals</CODE> - the identifying principals of the <code>Subject</code>/account logging out.</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/AbstractAuthenticator.html#line.164"><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>This implementation merely calls
<A HREF="../../../../org/apache/shiro/authc/AbstractAuthenticator.html#notifyLogout(org.apache.shiro.subject.PrincipalCollection)"><CODE>notifyLogout</CODE></A> to allow any registered listeners
to react to the logout.
<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></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>principals</CODE> - the identifying principals of the <code>Subject</code>/account logging out.</DL>
</DD>
</DL>
<HR>
<A NAME="authenticate(org.apache.shiro.authc.AuthenticationToken)"><!-- --></A><H3>
authenticate</H3>
<PRE>
public final <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/AbstractAuthenticator.html#line.188"><B>authenticate</B></A>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token)
throws <A HREF="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</A></PRE>
<DL>
<DD>Implementation of the <A HREF="../../../../org/apache/shiro/authc/Authenticator.html" title="interface in org.apache.shiro.authc"><CODE>Authenticator</CODE></A> interface that functions in the following manner:
<ol>
<li>Calls template <A HREF="../../../../org/apache/shiro/authc/AbstractAuthenticator.html#doAuthenticate(org.apache.shiro.authc.AuthenticationToken)"><CODE>doAuthenticate</CODE></A> method for subclass execution of the actual
authentication behavior.</li>
<li>If an <code>AuthenticationException</code> is thrown during <code>doAuthenticate</code>,
<A HREF="../../../../org/apache/shiro/authc/AbstractAuthenticator.html#notifyFailure(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationException)"><CODE>notify</CODE></A> any registered
<A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s of the exception and then propogate the exception
for the caller to handle.</li>
<li>If no exception is thrown (indicating a successful login),
<A HREF="../../../../org/apache/shiro/authc/AbstractAuthenticator.html#notifySuccess(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)"><CODE>notify</CODE></A> any registered
<A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationListener</CODE></A>s of the successful attempt.</li>
<li>Return the <code>AuthenticationInfo</code></li>
</ol>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/shiro/authc/Authenticator.html#authenticate(org.apache.shiro.authc.AuthenticationToken)">authenticate</A></CODE> in interface <CODE><A HREF="../../../../org/apache/shiro/authc/Authenticator.html" title="interface in org.apache.shiro.authc">Authenticator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>token</CODE> - the submitted token representing the subject's (user's) login principals and credentials.
<DT><B>Returns:</B><DD>the AuthenticationInfo referencing the authenticated user's account data.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</A></CODE> - if there is any problem during the authentication process - see the
interface's JavaDoc for a more detailed explanation.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/authc/ExpiredCredentialsException.html" title="class in org.apache.shiro.authc"><CODE>ExpiredCredentialsException</CODE></A>,
<A HREF="../../../../org/apache/shiro/authc/IncorrectCredentialsException.html" title="class in org.apache.shiro.authc"><CODE>IncorrectCredentialsException</CODE></A>,
<A HREF="../../../../org/apache/shiro/authc/ExcessiveAttemptsException.html" title="class in org.apache.shiro.authc"><CODE>ExcessiveAttemptsException</CODE></A>,
<A HREF="../../../../org/apache/shiro/authc/LockedAccountException.html" title="class in org.apache.shiro.authc"><CODE>LockedAccountException</CODE></A>,
<A HREF="../../../../org/apache/shiro/authc/ConcurrentAccessException.html" title="class in org.apache.shiro.authc"><CODE>ConcurrentAccessException</CODE></A>,
<A HREF="../../../../org/apache/shiro/authc/UnknownAccountException.html" title="class in org.apache.shiro.authc"><CODE>UnknownAccountException</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="doAuthenticate(org.apache.shiro.authc.AuthenticationToken)"><!-- --></A><H3>
doAuthenticate</H3>
<PRE>
protected abstract <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/AbstractAuthenticator.html#line.255"><B>doAuthenticate</B></A>(<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</A>&nbsp;token)
throws <A HREF="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</A></PRE>
<DL>
<DD>Template design pattern hook for subclasses to implement specific authentication behavior.
<p/>
Common behavior for most authentication attempts is encapsulated in the
<A HREF="../../../../org/apache/shiro/authc/AbstractAuthenticator.html#authenticate(org.apache.shiro.authc.AuthenticationToken)"><CODE>authenticate(org.apache.shiro.authc.AuthenticationToken)</CODE></A> method and that method invokes this one for custom behavior.
<p/>
<b>N.B.</b> Subclasses <em>should</em> throw some kind of
<code>AuthenticationException</code> if there is a problem during
authentication instead of returning <code>null</code>. A <code>null</code> return value indicates
a configuration or programming error, since <code>AuthenticationException</code>s should
indicate any expected problem (such as an unknown account or username, or invalid password, etc).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>token</CODE> - the authentication token encapsulating the user's login information.
<DT><B>Returns:</B><DD>an <code>AuthenticationInfo</code> object encapsulating the user's account information
important to Shiro.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</A></CODE> - if there is a problem logging in the user.</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/AbstractAuthenticator.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;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/authc/Account.html" title="interface in org.apache.shiro.authc"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/shiro/authc/AbstractAuthenticator.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AbstractAuthenticator.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-2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>