OIM API to Assign Admin Roles To User

package com.massiveGaze.users;

import com.massiveGaze.connection.Platform;

import oracle.iam.platform.authopss.api.AdminRoleService;
import oracle.iam.platform.authopss.vo.AdminRole;
import oracle.iam.platform.authopss.vo.AdminRoleMembership;

public class AssignAdminRolesToUser {

 public void adminRolesToUser(){
  AdminRoleService arsi = Platform.getService(AdminRoleService.class);
  
   String key="137";//Act_Key
  AdminRole ar= arsi.getAdminRole("OrclOIMUserViewer");
        AdminRoleMembership arm = new AdminRoleMembership("5", ar, key, true);
        arsi.addAdminRoleMembership(arm);
        AdminRole ar1= arsi.getAdminRole("OrclOIMOrgAdministrator");
        AdminRoleMembership arm1 = new AdminRoleMembership("5", ar1, key, true);
        arsi.addAdminRoleMembership(arm1);
        System.out.println("done");
 }
}

No comments:

Post a Comment

About OIM

Oracle Identity Management enables organizations to effectively manage the end - to - end life - cycle of user ide...

Popular Posts