diff -r b0dd05ec3db1 -r bab15bbe2ca3 jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java Tue Apr 28 11:10:45 2015 -0700
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java Wed Apr 29 17:29:14 2015 +0400
@@ -70,8 +70,8 @@
* conjunction with a specified search filter.
* If successful then authentication is attempted using the user's
* distinguished name and the supplied password.
- * To enable this mode, set the userFilter
option and omit the
- * authIdentity
option.
+ * To enable this mode, set the {@code userFilter} option and omit the
+ * {@code authIdentity} option.
* Use search-first mode when the user's distinguished name is not
* known in advance.
*
@@ -79,22 +79,22 @@
* supplied username and password and then the LDAP directory is searched.
* If authentication is successful then a search is performed using the
* supplied username in conjunction with a specified search filter.
- * To enable this mode, set the authIdentity
and the
- * userFilter
options.
+ * To enable this mode, set the {@code authIdentity} and the
+ * {@code userFilter} options.
* Use authentication-first mode when accessing an LDAP directory
* that has been configured to disallow anonymous searches.
*
*
In authentication-only mode, authentication is attempted using the
* supplied username and password. The LDAP directory is not searched because
* the user's distinguished name is already known.
- * To enable this mode, set the authIdentity
option to a valid
- * distinguished name and omit the userFilter
option.
+ * To enable this mode, set the {@code authIdentity} option to a valid
+ * distinguished name and omit the {@code userFilter} option.
* Use authentication-only mode when the user's distinguished name is
* known in advance.
*
*
The following option is mandatory and must be specified in this * module's login {@link Configuration}: - *
userProvider=ldap_urls
* %
')
+ * using the standard mechanism of percent character ('{@code %}')
* followed by two hexadecimal digits (see {@link java.net.URI}).
* Query components must also be omitted from the URL.
*
@@ -120,33 +120,33 @@
*
* This module also recognizes the following optional {@link Configuration} * options: - *
userFilter=ldap_filter
ldap_filter
is an LDAP filter string
+ * {@code ldap_filter} is an LDAP filter string
* (RFC 2254).
- * If it contains the special token "{USERNAME}
"
+ * If it contains the special token "{@code {USERNAME}}"
* then that token will be replaced with the supplied username value
* before the filter is used to search the directory. authIdentity=auth_id
auth_id
may be an LDAP distinguished name string
+ * {@code auth_id} may be an LDAP distinguished name string
* (RFC 2253) or some
* other string name.
- * It must contain the special token "{USERNAME}
"
+ * It must contain the special token "{@code {USERNAME}}"
* which will be replaced with the supplied username value before the
* name is used for authentication.
* Note that if this option does not contain a distinguished name then
- * the userFilter
option must also be specified. authzIdentity=authz_id
authz_id
is any string name.
+ * {@code authz_id} is any string name.
* If it comprises a single special token with curly braces then
* that token is treated as a attribute name and will be replaced with a
* single value of that attribute from the user's LDAP entry.
@@ -156,23 +156,23 @@
* is created using the authorization identity and it is associated with
* the current {@link Subject}. useSSL
false
, this module does not establish an SSL connection
+ * useFirstPass
true
, this module retrieves the username and password
+ * tryFirstPass
true
, this module retrieves the username and password
+ * storePass
true
, this module stores the username and password
+ * clearPass
true
, this module clears the username and password
+ * debug
true
, debug messages are displayed on the standard
+ * java.naming.provider.url
- * java.naming.security.principal
- * java.naming.security.credentials
- * java.naming.security.protocol
+ *
* Three sample {@link Configuration}s are shown below.
* The first one activates search-first mode. It identifies the LDAP server
- * and specifies that users' entries be located by their uid
and
- * objectClass
attributes. It also specifies that an identity
- * based on the user's employeeNumber
attribute should be created.
+ * and specifies that users' entries be located by their {@code uid} and
+ * {@code objectClass} attributes. It also specifies that an identity
+ * based on the user's {@code employeeNumber} attribute should be created.
* The second one activates authentication-first mode. It requests that the
* LDAP server be located dynamically, that authentication be performed using
* the supplied username directly but without the protection of SSL and that
* users' entries be located by one of three naming attributes and their
- * objectClass
attribute.
+ * {@code objectClass} attribute.
* The third one activates authentication-only mode. It identifies alternative
* LDAP servers, it specifies the distinguished name to use for
* authentication and a fixed identity to use for authorization. No directory
* search is performed.
*
- *
+ ** *{@literal * * ExampleApplication { * com.sun.security.auth.module.LdapLoginModule REQUIRED - * userProvider="ldap://ldap-svr/ou=people,dc=example,dc=com" - * userFilter="(&(uid={USERNAME})(objectClass=inetOrgPerson))" - * authzIdentity="{EMPLOYEENUMBER}" - * debug=true; + * userProvider="ldap://ldap-svr/ou=people,dc=example,dc=com" + * userFilter="(&(uid={USERNAME})(objectClass=inetOrgPerson))" + * authzIdentity="{EMPLOYEENUMBER}" + * debug=true; * }; * * ExampleApplication { @@ -258,7 +258,7 @@ * debug=true; * }; * - *+ * }
*
LoginModule
.
+ * Initialize this {@code LoginModule}.
*
- * @param subject the Subject
to be authenticated.
- * @param callbackHandler a CallbackHandler
to acquire the
+ * @param subject the {@code Subject} to be authenticated.
+ * @param callbackHandler a {@code CallbackHandler} to acquire the
* username and password.
- * @param sharedState shared LoginModule
state.
+ * @param sharedState shared {@code LoginModule} state.
* @param options options specified in the login
- * Configuration
for this particular
- * LoginModule
.
+ * {@code Configuration} for this particular
+ * {@code LoginModule}.
*/
// Unchecked warning from (Map Acquire the user's credentials and verify them against the
* specified LDAP directory.
*
- * @return true always, since this LoginModule
+ * @return true always, since this {@code LoginModule}
* should not be ignored.
* @exception FailedLoginException if the authentication fails.
- * @exception LoginException if this LoginModule
+ * @exception LoginException if this {@code LoginModule}
* is unable to perform the authentication.
*/
public boolean login() throws LoginException {
@@ -593,10 +592,10 @@
*
*
If this LoginModule's own authentication attempt
* succeeded (checked by retrieving the private state saved by the
- * login
method), then this method associates an
- * LdapPrincipal
and one or more UserPrincipal
s
- * with the Subject
located in the
- * LoginModule
. If this LoginModule's own
+ * {@code login} method), then this method associates an
+ * {@code LdapPrincipal} and one or more {@code UserPrincipal}s
+ * with the {@code Subject} located in the
+ * {@code LoginModule}. If this LoginModule's own
* authentication attempted failed, then this method removes
* any state that was originally saved.
*
@@ -662,7 +661,7 @@
*
*
If this LoginModule's own authentication attempt
* succeeded (checked by retrieving the private state saved by the
- * login
and commit
methods),
+ * {@code login} and {@code commit} methods),
* then this method cleans up any state that was originally saved.
*
* @exception LoginException if the abort fails.
@@ -697,10 +696,10 @@
* Logout a user.
*
*
This method removes the Principals
- * that were added by the commit
method.
+ * that were added by the {@code commit} method.
*
* @exception LoginException if the logout fails.
- * @return true in all cases since this LoginModule
+ * @return true in all cases since this {@code LoginModule}
* should not be ignored.
*/
public boolean logout() throws LoginException {