cancel
Showing results for 
Search instead for 
Did you mean: 

reset password application

Former Member
0 Kudos

Hello,

I am working with Netweaver Studio in a PDK 6.0 application. I want to create an application that reset the password of the portal user and send and email with the new passsword.

Does someone knows there is a method in the UME api or somewhere else that let me manage this kind of process??

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Marysol,

The following code has everything you need.

String uniqueId = uaf.getUserAccountByLogonId("hsharma").getUniqueID();
IUserMaint user  = UMFactory.getUserFactory().getMutableUser(uniqueId);
IUserAccount ua = UMFactory.getUserAccountFactory().getMutableUserAccount(uniqueId);
String password = "xxxx";
ua.setPassword(password);
ua.save();
ua.commit();
SendMailAsynch sendemail = new SendMailAsynch();
IUser performer = request.getUser();	  SendMailAsynch.generateEmailOnUMEvent(performer, user, "pswd_reset_performed", null, password);

Former Member
0 Kudos

HI Prakash,

I've deployed the similar application on EP. The password has been reseted successfully and there is no excepion throwed. But the user couldn't get the respons email. Do you know what has caused this issue ? Do we have to restart the server engine after deployed par on Portal?


Thanks in advance.

The source code is as bellow,

if (null != userObject&& userObject.getEmail().equalsIgnoreCase(userEmail.getValue().toString())) {

  IUserAccount ua = UMFactory .getUserAccountFactory().getUserAccountByLogonId(uid);

  IUserAccount mua =UMFactory .getUserAccountFactory() .getMutableUserAccount(ua.getUniqueID());

  String password =

  UMFactory.getSecurityPolicy().generatePassword();


  mua.setPassword(password);

  mua.save();

  mua.commit();

  SendMailAsynch.generateEmailOnUMEvent(

  userObject,

  userObject,

  "pswd_reset_performed",

  "You password of userID in Portal system has been reset. Please logon and change password as soon as possible.",

  password);

  

  conBean.setSuccessMsg(

  "Password Reset successful and was sent to your email.");

  break;

  } //end if

                 break;

  } //end try

  catch (UMException e) {

    conBean.setMsgID(

    "The userID does not exist, please input the right userID or contact authorization administrator directly.");

           

    }  //end catch

Answers (0)