cancel
Showing results for 
Search instead for 
Did you mean: 

Exception - CHANGE_NOT_ALLOWED whilst changing password

Former Member
0 Kudos

Hi,

Whilst trying to implement a change password functionality through a WD application, I've been encountering the following exception at the

commit statement -

Exception: com.sap.security.core.persistence.datasource.PersistenceException: CHANGE_NOT_ALLOWED

Here's the code snippet -

		IWDClientUser wdUser = WDClientUser.getCurrentUser();			
		IUser user = wdUser.getSAPUser();	
		IUserAccount[] acct = user.getUserAccounts();
		String userId  = acct[0].getLogonUid();	
                IUserAccountFactory accountFactory = UMFactory.getUserAccountFactory(); 
		IUserAccount account = accountFactory.getUserAccountByLogonId(userId);		
		IUserAccount mutableAccount = accountFactory.getMutableUserAccount(account.getUniqueID());
		mutableAccount.setPassword(oldPassword,newPassword);
		mutableAccount.setPasswordChangeRequired(false);
		mutableAccount.commit();

The API documentation for UME suggests that there are chances of an Exception on using IUserAccount.commit() method. I didn't quite comprehend this.

*********************************************************

Note: IUserAccount.commit() may raise UMException for SAP System user with following exception text:

Attribute com.sap.security.core.usermanagement|->passwordchangerequired can only be modified by changing or resetting the password if any datasource of class com.sap.security.core.persistence.datasource.imp.R3Persistence is responsible for writing it.

The exception may be raised in following cases

if it is used without using setPassword(String, String) or setPassword(String) in the same IPrincipalMaint.commit() transaction.

if following combination of setPasswordChangeRequired and setPassword(...) is used:

setPassword(String) and setPasswordChangeRequired(false)

setPassword(String, String) and setPasswordChangeRequired(true)

***********************************************************

Just wondering if anyone's experienced this before or may have any ideas about this?

Any help would be much appreciated (and rewarded with points)

Thanks,

Vicky

P.S I posted this message in the EP Content development area. Wasn't sure of its appropriate location. Didn't get any response so I'm posting it here as well.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vicky,

I have the same problem with logical attribute "passwordchangerequired", and don't understand how to set up value true instead of value false.

If you resolve it let me me know how.

Thanks in advance

Dmitriy

former_member182372
Active Contributor
0 Kudos

Hi Vicky,

Could you please post a stacktrace of exception?

Best regards, Maksim Rashchynski.