OIM Reset Password As Xelsysadmin API


  1. package com.oimacademy.password;

  2. import oracle.iam.identity.exception.NoSuchUserException;
  3. import oracle.iam.identity.exception.UserManagerException;
  4. import oracle.iam.identity.usermgmt.api.UserManager;
  5. import oracle.iam.platform.authz.exception.AccessDeniedException;
  6. import com.oimacademy.connection.Platform;
  7. public class ResetPasswordAsXelsysadmin { 
  8.  public static void resetPassword(String userKey) throws NoSuchUserException, UserManagerException, AccessDeniedException{
  9.   UserManager userManager = (UserManager) Platform.getService(UserManager.class); 
  10.   userManager.changePassword(userKey,"Pass_12345".toCharArray() , false);  
  11.  }
  12.  public static void main(String[] args) throws NoSuchUserException, UserManagerException, AccessDeniedException {
  13.   resetPassword("11021");
  14.  }
  15. }

No comments:

Post a Comment