Below jdbc provision rule. We are doing below 3 scenarios, but when it disable it will trigger disable and immediately it set back enable in the SailPoint account tab
any idea what is the issue.
When user is hire in sailpoint and db it is set to Admin =1
once user is disable in the sailpoint and in db it is set to Admin = 0
When user is rehire will request it again account Admin =1
Using Provisioning Rule, we can be able to disable the account, but when we are performing account aggregation all accounts come in the source with Enable state only. We have JDBC Build Map rule to achieve this case. Find below reference link and try JDBC BuildMap Rule | SailPoint Developer Community
Use below in the rule,
map.put(“IIQDisabled”, “true”);
You need to tell ISC when an account is to be set as disabled. You can either do it in the query used for account aggregation by adding a CASE statement, or you can follow what @gogubapu has suggested.
Query would look like
SELECT *, CASE WHEN...... AS IIQDisabled FROM tableName
where you will have to add the logic to return true or false as value for IIQDisabled attribute
sailpoint.connector.ConnectorException: The application script threw an exception: java.lang.ClassCastException: Cannot cast java.lang.Boolean to java.lang.String BSF info: BuildMap for JDBC at line: 0 column: columnNo
The rule throwing classCastException, it means you’re trying to store Boolean value into String, can you explain the logic to keep user record disable.
// Process the result set and populate the map
Map map = JDBCConnector.buildMapFromResultSet(result, schema);
String admin = (String) map.get("Admin");
try
{
//if you have any other conditions, you can add below
if( "false".equalsIgnoreCase(admin))
{
map.put("IIQDisabled","true");
map.put("Admin","false");
}
}
catch (Exception e)
{
// Handle SQL exception
log.info("======Error======="+e);
}
return map;
once we add this JDBC applicationwhen into identity profile provisining tab when the user is disable it should set to disable in sailpoint and DB side Admin=0
1.when user will raise the entitlement true (name of the entitlement is true) in the DB it will set to admin =1 and will aggregate and the entitlement is attached to true.
when the user account is disable it will set the disabled in IDN and DB also it is set to Admin=0 as showing in the below screenshot.
You may confirm after performing account aggregation, you’re getting ADMIN attribute value is 0 or 1, OR true or false. if you’re getting 0 or 1 change if condition accordingly.
When I Disable the user in IDN, it will provision the user and set to 0 in DB, but in IDN it will show true only. After 2 aggregation the account again set enable.
You may use above code recently posted. i saw some of your screenshots shared here and added some lines in above code: if condition satisfied you need use like below
map.put(“disabled”, true);
map.put(“IIQDisabled”, true);
You only said that if admin=1 attribute value user account should active, if admin=0 then account should in disabled state. can you confirm if admin=0 it is fetch true or false in the IDN.
in build map change like if admin=true keep account enable, if admin=false keep account disabled state.
can you share one user attributes to verify without buildmap rule aggregation, that user admin values, after performing disabled.
Use below code to achieve your use case, below code works when user admin attribute value active and disable attribute value false, then the particular account in IDN active, if admin attribute value false and the disabled attribute true or false that account in IDN keeps inactive.
Add account create code inside Create block. Modify block if for addition and removal of entitlement for that account . Only if you remove or add entitlements, then you can see ADD or REMOVAL in plan that will come as Accountrequest Operation.
if ( AccountRequest.Operation.Create.equals( account.getOperation() ) )