The changePassword method
- Organization of this page
Description
Changes the password of a user who is correctly authenticated with the specified name, uid, and oldPassword parameters. When single sign-on authentication information is registered, the contents of the single sign-on information repository are also changed.
This method is a static method.
Syntax
public static void changePassword(String name, String uid, String oldPassword, String newPassword) throws LoginException, SecurityException;
Parameters:
- name:
-
Specifies the application name (name) of the login module (LoginContext) used for authentication.
- uid:
-
Specifies the user ID to be changed.
- oldPassword:
-
Specifies the old password.
- newPassword:
-
Specifies the new password.
Exceptions
- javax.security.auth.login.LoginException:
-
Information necessary for authentication is missing or the user ID or password is wrong.
- java.lang.SecurityException:
-
Access permission is not granted.
Return value
None
Remarks
-
If the realm name, encryption key file, and information for access to the single sign-on information repository are all defined, single sign-on authentication information is changed. If not (that is, if definitions for single sign-on are not provided), that authentication information is not changed.
-
If an exception (NamingException) occurs in the repository or if encryption fails while single sign-on authentication information is registered, then this method fails with LoginException. In this case, the password change is rolled back. If this rollback fails, LoginException occurs. For details about the exception class, see 15.32 Exception classes.
-
If an application specified by name does not use WebPasswordLoginModule or WebPasswordLDAPLoginModule, LoginException occurs.
-
If the LDAP directory server is Active Directory, specify by name applications that use WebPasswordLDAPLoginModule.