Hello All,
I am trying to reset password by using this code:
import com.sap.security.api.IUser;
import com.sap.security.api.IUserAccount;
import com.sap.security.api.IUserFactory;
import com.sap.security.api.UMFactory;
import com.sap.security.api.*;
import com.sapportals.portal.prt.component.AbstractPortalComponent;
import com.sapportals.portal.prt.component.IPortalComponentRequest;
import com.sapportals.portal.prt.component.IPortalComponentResponse;
public class resetPwd extends AbstractPortalComponent
{ public void doContent( IPortalComponentRequest request, IPortalComponentResponse response)
{ try
{ String newpassword = new String ("apple123");
IUserFactory uf = UMFactory.getUserFactory();
IUser iu = uf.getUserByLogonID("yatinp");
response.write("Name = "+ iu.getDisplayName());
String str = iu.getUniqueID();
response.write("User Id ==> "+ str);
IUserMaint ium = uf.getMutableUser(str);
IUserAccountFactory iuf = UMFactory.getUserAccountFactory();
IUserAccount iua = iuf.getUserAccountByLogonId("yatinp");
// response.write(iua.getDisplayName());
iua.setPassword(newpassword);
iua.save();
iua.commit();
response.write("Pass");
But its not working.
Its giving me an error saying "<b><i>setPassword is not a mutatable method</i></b>".
I would appreciate if you please help me solve this query.
Thanks and Warm Regards,
Ritu R Hunjan