OIM Delete Password Policy API


  1. package com.oimacademy.password;
  2. import com.oimacademy.connection.OIMConnection;
  3. import oracle.iam.passwordmgmt.api.PasswordMgmtService;
  4. import oracle.iam.passwordmgmt.vo.PasswordPolicyInfo;
  5. public class DeletePasswordPolicy {
  6.  static PasswordMgmtService passwordmgmtService = OIMConnection.getConnection().getService(PasswordMgmtService.class);
  7.  public static void main(String[] args) throws Exception {
  8.   // TODO Auto-generated method stub 
  9.   deletePolicy("PasswordPolicy90");
  10.  }
  11.  public static void deletePolicy(String name){
  12.   // passwordmgmtService.delete(name) ;
  13.   PasswordPolicyInfo passPolicyInfo = new PasswordPolicyInfo();
  14.      passPolicyInfo.setPasswordExpiresAfterInDays(null);
  15.   passPolicyInfo.setName("PasswordPolicy1");
  16.   passwordmgmtService.update(passPolicyInfo);
  17.    passPolicyInfo=passwordmgmtService.getDetails(passPolicyInfo.getName());
  18.    System.out.println(passPolicyInfo.getId());
  19.    System.out.println(passPolicyInfo.getPasswordExpiresAfterInDays());
  20.  }
  21. }

No comments:

Post a Comment