blob: b9e5a23845be1e4b9730b857b586a8b933ffb67d [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:45 EST 2014 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
AuthenticationInfo (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="AuthenticationInfo (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/AuthenticationInfo.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/AuthenticationException.html" title="class in org.apache.shiro.authc"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.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/AuthenticationInfo.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AuthenticationInfo.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 AuthenticationInfo</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/Account.html" title="interface in org.apache.shiro.authc">Account</A>, <A HREF="../../../../org/apache/shiro/authc/MergableAuthenticationInfo.html" title="interface in org.apache.shiro.authc">MergableAuthenticationInfo</A>, <A HREF="../../../../org/apache/shiro/authc/SaltedAuthenticationInfo.html" title="interface in org.apache.shiro.authc">SaltedAuthenticationInfo</A></DD>
</DL>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/shiro/authc/SimpleAccount.html" title="class in org.apache.shiro.authc">SimpleAccount</A>, <A HREF="../../../../org/apache/shiro/authc/SimpleAuthenticationInfo.html" title="class in org.apache.shiro.authc">SimpleAuthenticationInfo</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <A HREF="../../../../src-html/org/apache/shiro/authc/AuthenticationInfo.html#line.58"><B>AuthenticationInfo</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>
<code>AuthenticationInfo</code> represents a Subject's (aka user's) stored account information relevant to the
authentication/log-in process only.
<p/>
It is important to understand the difference between this interface and the
<A HREF="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationToken</CODE></A> interface. <code>AuthenticationInfo</code> implementations
represent already-verified and stored account data, whereas an <code>AuthenticationToken</code> represents data
submitted for any given login attempt (which may or may not successfully match the verified and stored account
<code>AuthenticationInfo</code>).
<p/>
Because the act of authentication (log-in) is orthogonal to authorization (access control), this interface is
intended to represent only the account data needed by Shiro during an authentication attempt. Shiro also
has a parallel <A HREF="../../../../org/apache/shiro/authz/AuthorizationInfo.html" title="interface in org.apache.shiro.authz"><CODE>AuthorizationInfo</CODE></A> interface for use during the
authorization process that references access control data such as roles and permissions.
<p/>
But because many if not most <A HREF="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm"><CODE>Realm</CODE></A>s store both sets of data for a Subject, it might be
convenient for a <code>Realm</code> implementation to utilize an implementation of the <A HREF="../../../../org/apache/shiro/authc/Account.html" title="interface in org.apache.shiro.authc"><CODE>Account</CODE></A>
interface instead, which is a convenience interface that combines both <code>AuthenticationInfo</code> and
<code>AuthorizationInfo</code>. Whether you choose to implement these two interfaces separately or implement the one
<code>Account</code> interface for a given <code>Realm</code> is entirely based on your application's needs or your
preferences.
<p/>
<p><b>Pleae note:</b> Since Shiro sometimes logs authentication operations, please ensure your AuthenticationInfo's
<code>toString()</code> implementation does <em>not</em> print out account credentials (password, etc), as these might be viewable to
someone reading your logs. This is good practice anyway, and account credentials should rarely (if ever) be printed
out for any reason. If you're using Shiro's default implementations of this interface, they only ever print the
account <A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html#getPrincipals()"><CODE>principals</CODE></A>, so you do not need to do anything additional.</p>
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>0.9</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/authz/AuthorizationInfo.html" title="interface in org.apache.shiro.authz"><CODE>AuthorizationInfo</CODE></A>,
<A HREF="../../../../org/apache/shiro/authc/Account.html" title="interface in org.apache.shiro.authc"><CODE>Account</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/AuthenticationInfo.html#getCredentials()">getCredentials</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the credentials associated with the corresponding Subject.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html#getPrincipals()">getPrincipals</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all principals associated with the corresponding Subject.</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="getPrincipals()"><!-- --></A><H3>
getPrincipals</H3>
<PRE>
<A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</A> <A HREF="../../../../src-html/org/apache/shiro/authc/AuthenticationInfo.html#line.70"><B>getPrincipals</B></A>()</PRE>
<DL>
<DD>Returns all principals associated with the corresponding Subject. Each principal is an identifying piece of
information useful to the application such as a username, or user id, a given name, etc - anything useful
to the application to identify the current <code>Subject</code>.
<p/>
The returned PrincipalCollection should <em>not</em> contain any credentials used to verify principals, such
as passwords, private keys, etc. Those should be instead returned by <A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html#getCredentials()"><CODE>getCredentials()</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>all principals associated with the corresponding Subject.</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/AuthenticationInfo.html#line.80"><B>getCredentials</B></A>()</PRE>
<DL>
<DD>Returns the credentials associated with the corresponding Subject. A credential verifies one or more of the
<A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html#getPrincipals()"><CODE>principals</CODE></A> associated with the Subject, such as a password or private key. Credentials
are used by Shiro particularly during the authentication process to ensure that submitted credentials
during a login attempt match exactly the credentials here in the <code>AuthenticationInfo</code> instance.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the credentials associated with the corresponding Subject.</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/AuthenticationInfo.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/AuthenticationException.html" title="class in org.apache.shiro.authc"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/authc/AuthenticationListener.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/AuthenticationInfo.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AuthenticationInfo.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-2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>