blob: 4612f1e741a97fc2ac1954ec055adad46969003d [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>
AuthenticationToken (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="AuthenticationToken (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/AuthenticationToken.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/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/authc/Authenticator.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/AuthenticationToken.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AuthenticationToken.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;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&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>
Interface AuthenticationToken</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></DD>
</DL>
<DL>
<DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../../org/apache/shiro/authc/HostAuthenticationToken.html" title="interface in org.apache.shiro.authc">HostAuthenticationToken</A>, <A HREF="../../../../org/apache/shiro/authc/RememberMeAuthenticationToken.html" title="interface in org.apache.shiro.authc">RememberMeAuthenticationToken</A></DD>
</DL>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/shiro/cas/CasToken.html" title="class in org.apache.shiro.cas">CasToken</A>, <A HREF="../../../../org/apache/shiro/authc/UsernamePasswordToken.html" title="class in org.apache.shiro.authc">UsernamePasswordToken</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <A HREF="../../../../src-html/org/apache/shiro/authc/AuthenticationToken.html#line.60"><B>AuthenticationToken</B></A><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></DL>
</PRE>
<P>
<p>An <tt>AuthenticationToken</tt> is a consolidation of an account's principals and supporting
credentials submitted by a user during an authentication attempt.
<p/>
<p>The token is submitted to an <A HREF="../../../../org/apache/shiro/authc/Authenticator.html" title="interface in org.apache.shiro.authc"><CODE>Authenticator</CODE></A> via the
<A HREF="../../../../org/apache/shiro/authc/Authenticator.html#authenticate(org.apache.shiro.authc.AuthenticationToken)"><CODE>authenticate(token)</CODE></A> method. The
Authenticator then executes the authentication/log-in process.
<p/>
<p>Common implementations of an <tt>AuthenticationToken</tt> would have username/password
pairs, X.509 Certificate, PGP key, or anything else you can think of. The token can be
anything needed by an <A HREF="../../../../org/apache/shiro/authc/Authenticator.html" title="interface in org.apache.shiro.authc"><CODE>Authenticator</CODE></A> to authenticate properly.
<p/>
<p>Because applications represent user data and credentials in different ways, implementations
of this interface are application-specific. You are free to acquire a user's principals and
credentials however you wish (e.g. web form, Swing form, fingerprint identification, etc) and
then submit them to the Shiro framework in the form of an implementation of this
interface.
<p/>
<p>If your application's authentication process is username/password based
(like most), instead of implementing this interface yourself, take a look at the
<A HREF="../../../../org/apache/shiro/authc/UsernamePasswordToken.html" title="class in org.apache.shiro.authc"><CODE>UsernamePasswordToken</CODE></A> class, as it is probably sufficient for your needs.
<p/>
<p>RememberMe services are enabled for a token if they implement a sub-interface of this one, called
<A HREF="../../../../org/apache/shiro/authc/RememberMeAuthenticationToken.html" title="interface in org.apache.shiro.authc"><CODE>RememberMeAuthenticationToken</CODE></A>. Implement that interfac if you need
RememberMe services (the <tt>UsernamePasswordToken</tt> already implements this interface).
<p/>
<p>If you are familiar with JAAS, an <tt>AuthenticationToken</tt> replaces the concept of a
<A HREF="http://java.sun.com/javase/6/docs/api/javax/security/auth/callback/Callback.html?is-external=true" title="class or interface in javax.security.auth.callback"><CODE>Callback</CODE></A>, and defines meaningful behavior
(<tt>Callback</tt> is just a marker interface, and of little use). We
also think the name <em>AuthenticationToken</em> more accurately reflects its true purpose
in a login framework, whereas <em>Callback</em> is less obvious.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>0.1</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/authc/RememberMeAuthenticationToken.html" title="interface in org.apache.shiro.authc"><CODE>RememberMeAuthenticationToken</CODE></A>,
<A HREF="../../../../org/apache/shiro/authc/HostAuthenticationToken.html" title="interface in org.apache.shiro.authc"><CODE>HostAuthenticationToken</CODE></A>,
<A HREF="../../../../org/apache/shiro/authc/UsernamePasswordToken.html" title="class in org.apache.shiro.authc"><CODE>UsernamePasswordToken</CODE></A></DL>
<HR>
<P>
<!-- ========== 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="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html#getCredentials()">getCredentials</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the credentials submitted by the user during the authentication process that verifies
the submitted <A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html#getPrincipal()"><CODE>account identity</CODE></A>.</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/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html#getPrincipal()">getPrincipal</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the account identity submitted during the authentication process.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ 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="getPrincipal()"><!-- --></A><H3>
getPrincipal</H3>
<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">Object</A> <A HREF="../../../../src-html/org/apache/shiro/authc/AuthenticationToken.html#line.76"><B>getPrincipal</B></A>()</PRE>
<DL>
<DD>Returns the account identity submitted during the authentication process.
<p/>
<p>Most application authentications are username/password based and have this
object represent a username. If this is the case for your application,
take a look at the <A HREF="../../../../org/apache/shiro/authc/UsernamePasswordToken.html" title="class in org.apache.shiro.authc"><CODE>UsernamePasswordToken</CODE></A>, as it is probably
sufficient for your use.
<p/>
<p>Ultimately, the object returned is application specific and can represent
any account identity (user id, X.509 certificate, etc).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the account identity submitted during the authentication process.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/authc/UsernamePasswordToken.html" title="class in org.apache.shiro.authc"><CODE>UsernamePasswordToken</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getCredentials()"><!-- --></A><H3>
getCredentials</H3>
<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">Object</A> <A HREF="../../../../src-html/org/apache/shiro/authc/AuthenticationToken.html#line.92"><B>getCredentials</B></A>()</PRE>
<DL>
<DD>Returns the credentials submitted by the user during the authentication process that verifies
the submitted <A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html#getPrincipal()"><CODE>account identity</CODE></A>.
<p/>
<p>Most application authentications are username/password based and have this object
represent a submitted password. If this is the case for your application,
take a look at the <A HREF="../../../../org/apache/shiro/authc/UsernamePasswordToken.html" title="class in org.apache.shiro.authc"><CODE>UsernamePasswordToken</CODE></A>, as it is probably
sufficient for your use.
<p/>
<p>Ultimately, the credentials Object returned is application specific and can represent
any credential mechanism.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the credential submitted by the user during the authentication process.</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/AuthenticationToken.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/AuthenticationListener.html" title="interface in org.apache.shiro.authc"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/authc/Authenticator.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/AuthenticationToken.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AuthenticationToken.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;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&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>