OIM Auto Generate Password API


  1. package com.oimacademy.password;
  2. import java.util.logging.Logger;
  3. import oracle.iam.identity.exception.NoSuchUserException;
  4. import oracle.iam.identity.exception.UserManagerException;
  5. import oracle.iam.identity.usermgmt.api.UserManager;
  6. import oracle.iam.platform.authz.exception.AccessDeniedException;
  7. import com.oimacademy.connection.Platform;
  8. public class AutoGeneratePassword {
  9.  private static Logger logger = Logger.getLogger("MASSIVEGAZE.DEMO");
  10.  public AutoGeneratePassword() {
  11.   }
  12.  public static void main(String[] args) throws NoSuchUserException, UserManagerException, AccessDeniedException {
  13.   autoResetMethod();
  14.  }
  15.  public static void autoResetMethod() throws NoSuchUserException,
  16.    UserManagerException, AccessDeniedException {
  17.   String userLogin = "TUSER";
  18.   UserManager userManager = (UserManager) Platform.getService(UserManager.class);
  19.   userManager.resetPassword(userLogin, true, true);
  20.   System.out.println("Password for user " + userLogin    + " has been reset successfully!");
  21.  }
  22. }

No comments:

Post a Comment