⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 authfactory.html

📁 开源软件openfire的API文件。进行openfire的二次开发所必需的工具。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!-- ============ 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="getAuthProvider()"><!-- --></A><H3>getAuthProvider</H3><PRE>public static <A HREF="../../../../org/jivesoftware/openfire/auth/AuthProvider.html" title="interface in org.jivesoftware.openfire.auth">AuthProvider</A> <B>getAuthProvider</B>()</PRE><DL><DD>Returns the currently-installed AuthProvider. <b>Warning:</b> in virtually all cases the auth provider should not be used directly. Instead, the appropriate methods in AuthFactory should be called. Direct access to the auth provider is only provided for special-case logic.<P><DD><DL><DT><B>Returns:</B><DD>the current UserProvider.</DL></DD></DL><HR><A NAME="isPlainSupported()"><!-- --></A><H3>isPlainSupported</H3><PRE>public static boolean <B>isPlainSupported</B>()</PRE><DL><DD>Returns true if the currently installed <A HREF="../../../../org/jivesoftware/openfire/auth/AuthProvider.html" title="interface in org.jivesoftware.openfire.auth"><CODE>AuthProvider</CODE></A> supports authentication using plain-text passwords according to JEP-0078. Plain-text authentication is not secure and should generally only be used over a TLS/SSL connection.<P><DD><DL><DT><B>Returns:</B><DD>true if plain text password authentication is supported.</DL></DD></DL><HR><A NAME="isDigestSupported()"><!-- --></A><H3>isDigestSupported</H3><PRE>public static boolean <B>isDigestSupported</B>()</PRE><DL><DD>Returns true if the currently installed <A HREF="../../../../org/jivesoftware/openfire/auth/AuthProvider.html" title="interface in org.jivesoftware.openfire.auth"><CODE>AuthProvider</CODE></A> supports digest authentication according to JEP-0078.<P><DD><DL><DT><B>Returns:</B><DD>true if digest authentication is supported.</DL></DD></DL><HR><A NAME="getPassword(java.lang.String)"><!-- --></A><H3>getPassword</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getPassword</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;username)                          throws <A HREF="../../../../org/jivesoftware/openfire/user/UserNotFoundException.html" title="class in org.jivesoftware.openfire.user">UserNotFoundException</A>,                                 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang">UnsupportedOperationException</A></PRE><DL><DD>Returns the user's password. This method will throw an UnsupportedOperationException if this operation is not supported by the backend user store.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - the username of the user.<DT><B>Returns:</B><DD>the user's password.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/user/UserNotFoundException.html" title="class in org.jivesoftware.openfire.user">UserNotFoundException</A></CODE> - if the given user could not be found.<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if the provider does not      support the operation (this is an optional operation).</DL></DD></DL><HR><A NAME="authenticate(java.lang.String, java.lang.String)"><!-- --></A><H3>authenticate</H3><PRE>public static <A HREF="../../../../org/jivesoftware/openfire/auth/AuthToken.html" title="class in org.jivesoftware.openfire.auth">AuthToken</A> <B>authenticate</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;username,                                     <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;password)                              throws <A HREF="../../../../org/jivesoftware/openfire/auth/UnauthorizedException.html" title="class in org.jivesoftware.openfire.auth">UnauthorizedException</A>,                                     <A HREF="../../../../org/jivesoftware/openfire/auth/ConnectionException.html" title="class in org.jivesoftware.openfire.auth">ConnectionException</A>,                                     <A HREF="../../../../org/jivesoftware/openfire/auth/InternalUnauthenticatedException.html" title="class in org.jivesoftware.openfire.auth">InternalUnauthenticatedException</A></PRE><DL><DD>Authenticates a user with a username and plain text password and returns and AuthToken. If the username and password do not match the record of any user in the system, this method throws an UnauthorizedException.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - the username.<DD><CODE>password</CODE> - the password.<DT><B>Returns:</B><DD>an AuthToken token if the username and password are correct.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/auth/UnauthorizedException.html" title="class in org.jivesoftware.openfire.auth">UnauthorizedException</A></CODE> - if the username and password do not match any existing user      or the account is locked out.<DD><CODE><A HREF="../../../../org/jivesoftware/openfire/auth/ConnectionException.html" title="class in org.jivesoftware.openfire.auth">ConnectionException</A></CODE><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/auth/InternalUnauthenticatedException.html" title="class in org.jivesoftware.openfire.auth">InternalUnauthenticatedException</A></CODE></DL></DD></DL><HR><A NAME="authenticate(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>authenticate</H3><PRE>public static <A HREF="../../../../org/jivesoftware/openfire/auth/AuthToken.html" title="class in org.jivesoftware.openfire.auth">AuthToken</A> <B>authenticate</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;username,                                     <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;token,                                     <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;digest)                              throws <A HREF="../../../../org/jivesoftware/openfire/auth/UnauthorizedException.html" title="class in org.jivesoftware.openfire.auth">UnauthorizedException</A>,                                     <A HREF="../../../../org/jivesoftware/openfire/auth/ConnectionException.html" title="class in org.jivesoftware.openfire.auth">ConnectionException</A>,                                     <A HREF="../../../../org/jivesoftware/openfire/auth/InternalUnauthenticatedException.html" title="class in org.jivesoftware.openfire.auth">InternalUnauthenticatedException</A></PRE><DL><DD>Authenticates a user with a username, token, and digest and returns an AuthToken. The digest should be generated using the <A HREF="../../../../org/jivesoftware/openfire/auth/AuthFactory.html#createDigest(java.lang.String, java.lang.String)"><CODE>createDigest(String, String)</CODE></A> method. If the username and digest do not match the record of any user in the system, the method throws an UnauthorizedException.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - the username.<DD><CODE>token</CODE> - the token that was used with plain-text password to generate the digest.<DD><CODE>digest</CODE> - the digest generated from plain-text password and unique token.<DT><B>Returns:</B><DD>an AuthToken token if the username and digest are correct for the user's      password and given token.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/auth/UnauthorizedException.html" title="class in org.jivesoftware.openfire.auth">UnauthorizedException</A></CODE> - if the username and password do not match any      existing user or the account is locked out.<DD><CODE><A HREF="../../../../org/jivesoftware/openfire/auth/ConnectionException.html" title="class in org.jivesoftware.openfire.auth">ConnectionException</A></CODE><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/auth/InternalUnauthenticatedException.html" title="class in org.jivesoftware.openfire.auth">InternalUnauthenticatedException</A></CODE></DL></DD></DL><HR><A NAME="createDigest(java.lang.String, java.lang.String)"><!-- --></A><H3>createDigest</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>createDigest</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;token,                                  <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;password)</PRE><DL><DD>Returns a digest given a token and password, according to JEP-0078.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>token</CODE> - the token used in the digest.<DD><CODE>password</CODE> - the plain-text password to be digested.<DT><B>Returns:</B><DD>the digested result as a hex string.</DL></DD></DL><HR><A NAME="encryptPassword(java.lang.String)"><!-- --></A><H3>encryptPassword</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>encryptPassword</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;password)</PRE><DL><DD>Returns an encrypted version of the plain-text password. Encryption is performed using the Blowfish algorithm. The encryption key is stored as the Jive property "passwordKey". If the key is not present, it will be automatically generated.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>password</CODE> - the plain-text password.<DT><B>Returns:</B><DD>the encrypted password.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if encryption/decryption is not possible;      for example, during setup mode.</DL></DD></DL><HR><A NAME="decryptPassword(java.lang.String)"><!-- --></A><H3>decryptPassword</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>decryptPassword</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;encryptedPassword)</PRE><DL><DD>Returns a decrypted version of the encrypted password. Encryption is performed using the Blowfish algorithm. The encryption key is stored as the Jive property "passwordKey". If the key is not present, it will be automatically generated.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>encryptedPassword</CODE> - the encrypted password.<DT><B>Returns:</B><DD>the encrypted password.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if encryption/decryption is not possible;      for example, during setup mode.</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="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><b>Openfire 3.6.0a Javadoc</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;PREV CLASS&nbsp;&nbsp;<A HREF="../../../../org/jivesoftware/openfire/auth/AuthorizationManager.html" title="class in org.jivesoftware.openfire.auth"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html?org/jivesoftware/openfire/auth/AuthFactory.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="AuthFactory.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><i>Copyright &copy; 2003-2008 Jive Software.</i></BODY></HTML>

⌨️ 快捷键说明

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