Customizing Delegate for the Forgot-Reset Password Utility
This topic explains how a user can reset their password by customizing delegate class.
For any kind of user validation, you can write the server-level customization. Customization hooks are provided for the following three APIs:
public String generatePassword() throws exception
public String getMailSubject()
public String getMailContent(final String newPassword, String remoteIp) throws WTException, AddressException
To write your own customization, you must override these properties in the file sc.service.properties.xconf with its delegate class. Path to xconf: <HOME>\SW\SW\Applications\Windchill.ear\codebase.war\com\ptc\sc\xconf
<Service context="default" name="com.ptc.sc.services.plugins.UserCredDelegate">
<Option serviceClass="com.ptc.sc.services.plugins.DefaultUserCredDelegate" requestor="null"/>
</Service>
After making these changes, run the following command from the Windchill shell:xconfmanager –p The default implementation is given as DefaultUserCredDelegate. The default implementation looks as shown in the following image.
You can overwrite DefaultUserCredDelegate with your implementation class as follows.
1. API_1—generatePassword: This API supports overwriting the default, generating a temporary dynamic password. PTC Arbortext Content Delivery provides a default implementation, which dynamically generates an eight-letter password.
2. API_2—getMailSubject: This API supports a custom subject line for the mail. This API return type is String.
3. API_3—getMailContent: This API supports generating your email content. You can customize your email content here. This API return type is String. It has two parameters:
newPassword—this is the newly generated password
remoteIp—this is the IP of the machine from where the forgot password is triggered in order to catch malicious activity.
The mail host responsible for sending email to the user can be configured from the wt.properties file by overwriting the wt.mail.mailhost property using the command Xconfmanager –s<propertyname=value> –t <file name>.For example, you can use the emailService to send the email (you can write your own email service) via the mailHost set in wt.properties file.
Was this helpful?