loginmodule.html

来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 408 行 · 第 1/2 页

HTML
408
字号
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/security/auth/spi/LoginModule.html#login()">login</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to authenticate a <code>Subject</code> (phase 1).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/security/auth/spi/LoginModule.html#logout()">logout</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method which logs out a <code>Subject</code>.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->


<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)"><!-- --></A><H3>
initialize</H3>
<PRE>
public void <B>initialize</B>(<A HREF="../../../../javax/security/auth/Subject.html">Subject</A>&nbsp;subject,
                       <A HREF="../../../../javax/security/auth/callback/CallbackHandler.html">CallbackHandler</A>&nbsp;callbackHandler,
                       java.util.Map&nbsp;sharedState,
                       java.util.Map&nbsp;options)</PRE>
<DL>
<DD>Initialize this LoginModule.

 <p> This method is called by the <code>LoginContext</code>
 after this <code>LoginModule</code> has been instantiated.
 The purpose of this method is to initialize this
 <code>LoginModule</code> with the relevant information.
 If this <code>LoginModule</code> does not understand
 any of the data stored in <code>sharedState</code> or
 <code>options</code> parameters, they can be ignored.

 <p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>subject</CODE> - the <code>Subject</code> to be authenticated. <p><DD><CODE>callbackHandler</CODE> - a <code>CallbackHandler</code> for communicating
			with the end user (prompting for usernames and
			passwords, for example). <p><DD><CODE>sharedState</CODE> - state shared with other configured LoginModules. <p><DD><CODE>options</CODE> - options specified in the login
			<code>Configuration</code> for this particular
			<code>LoginModule</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="login()"><!-- --></A><H3>
login</H3>
<PRE>
public boolean <B>login</B>()
              throws <A HREF="../../../../javax/security/auth/login/LoginException.html">LoginException</A></PRE>
<DL>
<DD>Method to authenticate a <code>Subject</code> (phase 1).

 <p> The implementation of this method authenticates
 a <code>Subject</code>.  For example, it may prompt for
 <code>Subject</code> information such
 as a username and password and then attempt to verify the password.
 This method saves the result of the authentication attempt
 as private state within the LoginModule.

 <p><DD><DL>
<DT><B>Returns:</B><DD>true if the authentication succeeded, or false if this
			<code>LoginModule</code> should be ignored.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../javax/security/auth/login/LoginException.html">LoginException</A></CODE> - if the authentication fails</DL>
</DD>
</DL>
<HR>

<A NAME="commit()"><!-- --></A><H3>
commit</H3>
<PRE>
public boolean <B>commit</B>()
               throws <A HREF="../../../../javax/security/auth/login/LoginException.html">LoginException</A></PRE>
<DL>
<DD>Method to commit the authentication process (phase 2).

 <p> This method is called if the LoginContext's
 overall authentication succeeded
 (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules
 succeeded).

 <p> If this LoginModule's own authentication attempt
 succeeded (checked by retrieving the private state saved by the
 <code>login</code> method), then this method associates relevant
 Principals and Credentials with the <code>Subject</code> located in the
 <code>LoginModule</code>.  If this LoginModule's own
 authentication attempted failed, then this method removes/destroys
 any state that was originally saved.

 <p><DD><DL>
<DT><B>Returns:</B><DD>true if this method succeeded, or false if this
			<code>LoginModule</code> should be ignored.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../javax/security/auth/login/LoginException.html">LoginException</A></CODE> - if the commit fails</DL>
</DD>
</DL>
<HR>

<A NAME="abort()"><!-- --></A><H3>
abort</H3>
<PRE>
public boolean <B>abort</B>()
              throws <A HREF="../../../../javax/security/auth/login/LoginException.html">LoginException</A></PRE>
<DL>
<DD>Method to abort the authentication process (phase 2).

 <p> This method is called if the LoginContext's
 overall authentication failed.
 (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules
 did not succeed).

 <p> If this LoginModule's own authentication attempt
 succeeded (checked by retrieving the private state saved by the
 <code>login</code> method), then this method cleans up any state
 that was originally saved.

 <p><DD><DL>
<DT><B>Returns:</B><DD>true if this method succeeded, or false if this
			<code>LoginModule</code> should be ignored.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../javax/security/auth/login/LoginException.html">LoginException</A></CODE> - if the abort fails</DL>
</DD>
</DL>
<HR>

<A NAME="logout()"><!-- --></A><H3>
logout</H3>
<PRE>
public boolean <B>logout</B>()
               throws <A HREF="../../../../javax/security/auth/login/LoginException.html">LoginException</A></PRE>
<DL>
<DD>Method which logs out a <code>Subject</code>.  

 <p>An implementation of this method might remove/destroy a Subject's
 Principals and Credentials.

 <p><DD><DL>
<DT><B>Returns:</B><DD>true if this method succeeded, or false if this
			<code>LoginModule</code> should be ignored.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../javax/security/auth/login/LoginException.html">LoginException</A></CODE> - if the logout fails</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <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="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;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="LoginModule.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&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>
<!-- =========== END OF NAVBAR =========== -->

<HR>

</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?