<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<!-- Generated by javadoc (build 1.6.0_10) on Tue Nov 17 12:13:37 PST 2009 -->
<
META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Authenticator (JavaMail API documentation)
<
META NAME="date" CONTENT="2009-11-17">
<
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="Authenticator (JavaMail API documentation)";
}
}
<
BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= 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="">
<
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> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-summary.html"><
FONT CLASS="NavBarFont1"><
B>Package<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <
FONT CLASS="NavBarFont1Rev"><
B>Class<
/B><
/FONT> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="class-use/Authenticator.html"><
FONT CLASS="NavBarFont1"><
B>Use<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-tree.html"><
FONT CLASS="NavBarFont1"><
B>Tree<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../deprecated-list.html"><
FONT CLASS="NavBarFont1"><
B>Deprecated<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../index-files/index-1.html"><
FONT CLASS="NavBarFont1"><
B>Index<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../help-doc.html"><
FONT CLASS="NavBarFont1"><
B>Help<
/B><
/FONT><
/A> <
/TD>
<
TD ALIGN="right" VALIGN="top" ROWSPAN=3><
EM>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../javax/mail/AuthenticationFailedException.html" title="class in javax.mail"><
B>PREV CLASS<
/B><
/A>
<
A HREF="../../javax/mail/BodyPart.html" title="class in javax.mail"><
B>NEXT CLASS<
/B><
/A><
/FONT><
/TD>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../index.html?javax/mail/Authenticator.html" target="_top"><
B>FRAMES<
/B><
/A>
<
A HREF="Authenticator.html" target="_top"><
B>NO FRAMES<
/B><
/A>
<
SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
<
A HREF="../../allclasses-noframe.html"><
B>All Classes<
/B><
/A>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <
A HREF="#constructor_summary">CONSTR<
/A> | <
A HREF="#method_summary">METHOD<
/A><
/FONT><
/TD>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
DETAIL: FIELD | <
A HREF="#constructor_detail">CONSTR<
/A> | <
A HREF="#method_detail">METHOD<
/A><
/FONT><
/TD>
<
A NAME="skip-navbar_top"><
/A>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<
A HREF="http://java.sun.com/j2se/1.4.2/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>javax.mail.Authenticator<
/B>
<
DT><
PRE>public abstract
class <
B>Authenticator<
/B><
DT>extends <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object<
/A><
/DL>
The class Authenticator represents an object that knows how to obtain
authentication for a network connection. Usually, it will do this
by prompting the user for information.
Applications use this class by creating a subclass, and registering
an instance of that subclass with the session when it is created.
When authentication is required, the system will invoke a method
on the subclass (like getPasswordAuthentication). The subclass's
method can query about the authentication being requested with a
number of inherited methods (getRequestingXXX()), and form an
appropriate message for the user.
<p>
All methods that request authentication have a default implementation
that fails.
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/net/Authenticator.html?is-external=true" title="class or interface in java.net"><CODE>Authenticator</CODE></A>,
<A HREF="../../javax/mail/Session.html#getInstance(java.util.Properties, javax.mail.Authenticator)"><CODE>Session.getInstance(java.util.Properties,
javax.mail.Authenticator)</CODE></A>,
<A HREF="../../javax/mail/Session.html#getDefaultInstance(java.util.Properties, javax.mail.Authenticator)"><CODE>Session.getDefaultInstance(java.util.Properties,
javax.mail.Authenticator)</CODE></A>,
<A HREF="../../javax/mail/Session.html#requestPasswordAuthentication(java.net.InetAddress, int, java.lang.String, java.lang.String, java.lang.String)"><CODE>Session.requestPasswordAuthentication(java.net.InetAddress, int, java.lang.String, java.lang.String, java.lang.String)</CODE></A>,
<A HREF="../../javax/mail/PasswordAuthentication.html" title="class in javax.mail"><CODE>PasswordAuthentication</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="../../javax/mail/Authenticator.html#Authenticator()">Authenticator</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== 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 <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Authenticator.html#getDefaultUserName()">getDefaultUserName</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../javax/mail/PasswordAuthentication.html" title="class in javax.mail">PasswordAuthentication</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Authenticator.html#getPasswordAuthentication()">getPasswordAuthentication</A></B>()</CODE>
<BR>
Called when password authentication is needed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Authenticator.html#getRequestingPort()">getRequestingPort</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Authenticator.html#getRequestingPrompt()">getRequestingPrompt</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Authenticator.html#getRequestingProtocol()">getRequestingProtocol</A></B>()</CODE>
<BR>
Give the protocol that's requesting the connection.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE>protected <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html?is-external=true" title="class or interface in java.net">InetAddress<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Authenticator.html#getRequestingSite()">getRequestingSite<
/A><
/B>
()<
/CODE>
<
/TD>
<
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/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object<
/A><
/B><
/TH>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD><
CODE><
A HREF="http://java.sun.com/j2se/1.4.2/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/j2se/1.4.2/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/j2se/1.4.2/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/j2se/1.4.2/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/j2se/1.4.2/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/j2se/1.4.2/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/j2se/1.4.2/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/j2se/1.4.2/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/j2se/1.4.2/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/j2se/1.4.2/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/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait<
/A><
/CODE><
/TD>
<!-- ========= 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">
<
A NAME="Authenticator()"><!-- --><
/A><
H3>
public <
B>Authenticator<
/B>
()<
/PRE>
<!-- ============ 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">
<
A NAME="getRequestingSite()"><!-- --><
/A><
H3>
protected final <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html?is-external=true" title="class or interface in java.net">InetAddress<
/A> <
B>getRequestingSite<
/B>
()<
/PRE>
<
DT><
B>Returns:<
/B><
DD>the InetAddress of the site requesting authorization, or null
if it's not available.</DL>
</DD>
</DL>
<HR>
<A NAME="getRequestingPort()"><!-- --></A><H3>
getRequestingPort</H3>
<PRE>
protected final int <B>getRequestingPort</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>the port for the requested connection</DL>
</DD>
</DL>
<HR>
<A NAME="getRequestingProtocol()"><!-- --></A><H3>
getRequestingProtocol</H3>
<PRE>
protected final <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getRequestingProtocol</B>()</PRE>
<DL>
<DD>Give the protocol that's requesting the connection. Often this
will be based on a URLName.
<
DT><
B>Returns:<
/B><
DD>the protcol<
DT><
B>See Also:<
/B><
DD><
A HREF="../../javax/mail/URLName.html#getProtocol()"><
CODE>URLName.getProtocol
()<
/CODE><
/A><
/DL>
<
A NAME="getRequestingPrompt()"><!-- --><
/A><
H3>
protected final <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> <
B>getRequestingPrompt<
/B>
()<
/PRE>
<
DT><
B>Returns:<
/B><
DD>the
prompt string given by the requestor<
/DL>
<
A NAME="getDefaultUserName()"><!-- --><
/A><
H3>
protected final <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> <
B>getDefaultUserName<
/B>
()<
/PRE>
<
DT><
B>Returns:<
/B><
DD>the default user
name given by the requestor<
/DL>
<
A NAME="getPasswordAuthentication()"><!-- --><
/A><
H3>
getPasswordAuthentication<
/H3>
protected <
A HREF="../../javax/mail/PasswordAuthentication.html" title="class in javax.mail">PasswordAuthentication<
/A> <
B>getPasswordAuthentication<
/B>
()<
/PRE>
<
DD>Called when password authentication is needed. Subclasses should
override the default implementation, which returns null. <
p>
Note that if this method uses a dialog to prompt the user for this
information, the dialog needs to block until the user supplies the
information. This method can not simply return after showing the
dialog.
<
DT><
B>Returns:<
/B><
DD>The PasswordAuthentication collected from the
user, or null if none is provided.<
/DL>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= 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="">
<
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> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-summary.html"><
FONT CLASS="NavBarFont1"><
B>Package<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <
FONT CLASS="NavBarFont1Rev"><
B>Class<
/B><
/FONT> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="class-use/Authenticator.html"><
FONT CLASS="NavBarFont1"><
B>Use<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-tree.html"><
FONT CLASS="NavBarFont1"><
B>Tree<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../deprecated-list.html"><
FONT CLASS="NavBarFont1"><
B>Deprecated<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../index-files/index-1.html"><
FONT CLASS="NavBarFont1"><
B>Index<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../help-doc.html"><
FONT CLASS="NavBarFont1"><
B>Help<
/B><
/FONT><
/A> <
/TD>
<
TD ALIGN="right" VALIGN="top" ROWSPAN=3><
EM>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../javax/mail/AuthenticationFailedException.html" title="class in javax.mail"><
B>PREV CLASS<
/B><
/A>
<
A HREF="../../javax/mail/BodyPart.html" title="class in javax.mail"><
B>NEXT CLASS<
/B><
/A><
/FONT><
/TD>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../index.html?javax/mail/Authenticator.html" target="_top"><
B>FRAMES<
/B><
/A>
<
A HREF="Authenticator.html" target="_top"><
B>NO FRAMES<
/B><
/A>
<
SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
<
A HREF="../../allclasses-noframe.html"><
B>All Classes<
/B><
/A>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <
A HREF="#constructor_summary">CONSTR<
/A> | <
A HREF="#method_summary">METHOD<
/A><
/FONT><
/TD>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
DETAIL: FIELD | <
A HREF="#constructor_detail">CONSTR<
/A> | <
A HREF="#method_detail">METHOD<
/A><
/FONT><
/TD>
<
A NAME="skip-navbar_bottom"><
/A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
Copyright &#
169;
2009 <
a href="http://www.sun.com">Sun Microsystems, Inc.<
/a>. All Rights Reserved.