Maintenance Notice - PDF Generation
Dynamic PDF generation for web-based content is temporarily unavailable. This maintenance affects dynamic PDF files that are generated from either the HTML-based page or manual that you are viewing. Links that normally allow this functionality have been hidden, and will reappear as soon as the feature is restored.


Note: Access to static files, including PDF files that are not dynamically generated from our web-based content, is unaffected.

Jump to: navigation, search

Change Password On Next Login

This page shows examples of how a Configuration Server connection can be opened, using either a standard login or with a forced password change on login.

Scenario: Standard Login

The following code shows a standard login process, without this feature enabled:

ConfServerProtocol protocol = new ConfServerProtocol(new Endpoint("cfgsrv", csHost, csPort));
protocol.setClientName(clientAppName);
protocol.setClientApplicationType(clientAppType.ordinal());
protocol.setUserName(userName);
protocol.setUserPassword(userPasswd);
protocol.open();

Scenario: Change Password on Next Login

When the user has enabled the Change Password on Next Login feature, protocol.open() throws ChangePasswordException. This exception should be caught and handled to force the password update.

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 and protocol.getUserPassword() will be set to the newPasswd value that was specified during login.

Scenario: Standard Login

The following code shows a standard login process, without this feature enabled:

ConfServerProtocol protocol = new ConfServerProtocol(new Endpoint("cfgsrv", csHost, csPort));
protocol.ClientName = clientAppName;
protocol.ClientApplicationType = clientAppType;
protocol.UserName = userName;
protocol.UserPassword = userPassword;
protocol.Open();

Scenario: Change Password on Next Login

When the user has enabled the Change Password on Next Login feature, protocol.open() throws ChangePasswordException. This exception should be caught and handled to force the password update.

So the resulting code may look like:

ConfServerProtocol protocol = new ConfServerProtocol(new Endpoint("cfgsrv", csHost, csPort));
protocol.ClientName = clientAppName;
protocol.ClientApplicationType = clientAppType;
protocol.UserName = userName;
protocol.UserPassword = userPassword;
try
{
  protocol.Open();
}catch(ChangePasswordException)
{
  string newPassword= ...; // obtain new user password
  protocol.UseChangePasswordRegistration(newPassword);
  protocol.Open();
}

After a successful open procedure, the new password value will be accepted and protocol.UserPassword will be set to the newPasswd value that was specified during login.

This page was last edited on December 24, 2013, at 19:03.

Feedback

Comment on this article:

blog comments powered by Disqus