cancel
Showing results for 
Search instead for 
Did you mean: 

Change user password

Former Member
0 Kudos

Hi all,

Is possible to change password of current user?

I read password with this code:

IWDClientUser wdUser = WDClientUser.getCurrentUser();

IUser user = wdUser.getSAPUser();

IUserAccount[] IUA = user.getUserAccounts();

String password = IUA[0].getHashedPassword();

but I don't find method to set new password...

Thanks

Andrea

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

Hello Andrea,

Hm...From here https://media.sdn.sap.com/javadocs/NW04/SP9/ume/com/sap/security/api/IUserAccount.html

I`m getting following:

...

void setPassword(java.lang.String pass)

Changes user password to newpass.

void setPassword(java.lang.String oldpass, java.lang.String newpass)

Changes user password from oldpass to newpass.

...

best regards, Maksim Rashchynski.

Former Member
0 Kudos

...

See

UMFactory.getUserAccountFactory().getMutableUserAccount("logon-id").*

first one for "process mode": application change or reset password itself, user has to change password on next logon (there should one other method called setPasswordChangeRequired() )

second one for "interactive mode": user initates password changing and provides old and new password.

VS

Message was edited by: Valery Silaev

Former Member
0 Kudos

Now I can change password but it works only first time. When I retry i have this error:

com.sap.security.api.InvalidPasswordException: CHANGE_NOT_ALLOWED

Maybe new password is set to read only...

Thanks

Andrea

former_member182372
Active Contributor
0 Kudos

Hello Andrea,

Just guess - after changing password user must login at least one time.

Best regards, Maksim Rashchynski.