cancel
Showing results for 
Search instead for 
Did you mean: 

No password expiration date

Former Member
0 Kudos

Hi all,

I am working on a web service in order to modify the password expiration date.

In particular, they requested me to set password never expires at user's creation moment.

I wrote something like this:

uacc = UMFactory.getUserAccountFactory().newUserAccount(susUserName, newUser.getUniqueID());

uacc.setPassword(susUserPassword);

uacc.setPasswordChangeRequired(false);

but users continue to be created with the usual password expiration date.

I tried to search something in my library that could help me, but with no luck. In particular, I tried using the method setPasswodExpirationDate of ISecurityPolicy and of class SecurityPolicy, but I cannot find a method to link this methods to user account. I have also seen that changing the security policy to "Technical User" I may overcome the problem, but the method setSecurityPolicy is not implemented in the libraries on server.

Could you please give me some advices on this topic? I really do not have anymore ideas.

Best Regards,

Francesco Macaluso

Accepted Solutions (1)

Accepted Solutions (1)

former_member182598
Active Contributor
0 Kudos

Use the below code to set your user as technical user.



    		IUserAccountFactory uaFactory= UMFactory.getUserAccountFactory();
    		IUserAccount userAccount=uaFactory.getUserAccountByLogonId("<userID");
    		IUserAccount mutableUserAccount=uaFactory.getMutableUserAccount(userAccount.getUniqueID());
    		mutableUserAccount.setAttribute("com.sap.security.core.usermanagement","SecurityPolicy",new String[]{IUserAccount.SECURITY_POLICY_TYPE_TECHNICAL});    		
    		mutableUserAccount.commit();

Thanks

Prashant

Former Member
0 Kudos

Thanks Prashant!

You saved me!

It was exactly what I needed!

Thank you again!

Best Regards,

Francesco

Answers (0)