package com.massiveGaze.role; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.HashMap; import com.massiveGaze.orgs.CreateOrganizations; import com.massiveGaze.users.CreateUsers; import oracle.iam.identity.exception.ValidationFailedException; import oracle.iam.identity.rolemgmt.api.RoleManager; import oracle.iam.identity.rolemgmt.api.RoleManagerConstants; import oracle.iam.platform.Platform; public class GrantRoleWithDate { public static void main(String[] args) throws NumberFormatException, Exception { //local variables Date currentDate = new Date(); String str_Date = ""; SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); Calendar cal = new GregorianCalendar(); str_Date = formatter.format(cal.getTime()); Date endDate = (Date) formatter.parse(str_Date); System.out.println("EndDate::::::" + endDate); //Create requester and role. String userKey=CreateUsers.createUsers(Long.parseLong(CreateOrganizations.createorg())); String roleKey = CreateRoles.createRole(); try { //Login as requester and initiate role request; HashMap<String, Object> roleDataMap = new HashMap<String, Object>(); RoleManager roleManagerService_1=Platform.getService(RoleManager.class); roleDataMap.put(RoleManagerConstants.TEMPORAL_END_DATE, endDate); String requestID = roleManagerService_1.grantRoleRequest( "RoleKey", roleKey, "usr_key", userKey, roleDataMap); System.out.println( "Requst ID should not be Generated "); } catch(ValidationFailedException e) { System.out.println( "End Date cannot be set to prior to the Current Date:::" + e.getErrorMessage()); } } }
Oracle Identity Manager (OIM R2PS2/PS3/12C) is a highly flexible and scalable enterprise identity administration system that provides operational and business efficiency by providing centralized administration & complete automation of identity and user provisioning events across enterprise as well as extranet applications.
OIM API To Create User,Role and Grant Role with Date
Subscribe to:
Posts (Atom)
About OIM
Oracle Identity Management enables organizations to effectively manage the end - to - end life - cycle of user ide...
Popular Posts
-
OIM API's Sample Code : Videos: Massive Gaze Videos Connection Related API's : OIM DB Connection/ Data Source connection ...
-
Videos: Massive Gaze Videos 1. Basic OIM Information 2. MDS Export/Import 3. Steps For R2PS2 / R2PS3 Custom Pre-processor Ev...
-
Videos: Massive Gaze Videos 1. Query to get OIM Provsioned/provisioning Account details 2. Query to get usr keys For Rejected / ...
No comments:
Post a Comment