Change Password On Next Login
An example of the usual Configuration Server connection open scenario is provided below:
ConfServerProtocol protocol = new ConfServerProtocol(new Endpoint("cfgsrv", csHost, csPort)); protocol.setClientName(clientAppName); protocol.setClientApplicationType(clientAppType.ordinal()); protocol.setUserName(userName); protocol.setUserPassword(userPasswd); protocol.open();
When the user has enabled the Change Password on Next Login feature, protocol.open() throws ChangePasswordException.
So the resulting code may look like:
ConfServerProtocol protocol = new ConfServerProtocol(new Endpoint("cfgsrv", csHost, csPort)); protocol.setClientName(clientAppName); protocol.setClientApplicationType(clientAppType.ordinal()); protocol.setUserName(userName); protocol.setUserPassword(userPasswd); try { protocol.open(); } catch (ChangePasswordException e) { String newPasswd = ...; // obtain new user password protocol.useChangePasswordRegistration(newPasswd); protocol.open(); }
After a successful open procedure, the new password value will be accepted, so protocol.getUserPassword() will be equal to newPasswd value specified.
This page was last edited on September 26, 2013, at 15:01.
Comments or questions about this documentation? Contact us for support!