# WebServiceBeforeOperation Rule doesnt seem to do anything

**URL:** <https://developer.sailpoint.com/discuss/t/webservicebeforeoperation-rule-doesnt-seem-to-do-anything/190044>\
**Category:** SHF Discussion and Questions\
**Tags:** webservice-connector, rules, sailpoint-identity-security\
**Created:** [December 4, 2025, 6:05pm UTC](https://developer.sailpoint.com/discuss/t/webservicebeforeoperation-rule-doesnt-seem-to-do-anything/190044 "2025-12-04T18:05:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BFrescoKB](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@BFrescoKB](https://developer.sailpoint.com/discuss/u/BFrescoKB)\
**Post date:** [December 4, 2025, 6:05pm UTC](https://developer.sailpoint.com/discuss/t/webservicebeforeoperation-rule-doesnt-seem-to-do-anything/190044/1 "2025-12-04T18:05:47Z")

</div>

I am creating a WebServiceBeforeOperation rule that interceps the Password during the Change Password operation and encodes it with Base64 and then salts which is an attribute on the application account itself. But the operation doesnt seem to do anything at all, where am I missing the point:

```auto
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import connector.common.JsonUtil;
import connector.common.Util;
import sailpoint.connector.webservices.EndPoint;
import sailpoint.connector.webservices.WebServicesClient;
import sailpoint.object.Application;
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.AccountRequest;              
               
log.error("Rule - Provisioning Body: running");
Map body = requestEndPoint.getBody();
 
try {
    Map jsonMap = JsonUtil.toMap(jsonBody);
    password = "";
    if (provisioningPlan != null) {
        for (AccountRequest accReq : Util.iterate(provisioningPlan.getAccountRequests())) {
            for (ProvisioningPlan.AttributeRequest attReq : Util.iterate(accReq.getAttributeRequests())) {
                String attrName = attReq.getName();
                if (attrName != null && "password".equalsIgnoreCase(attrName)) {
                    password = (String) attReq.getValue();
                    log.error("Rule - Modify Body: password is present in plan = " + password);
					try {
                            // Hash the password with the salt using SHA-256
                            MessageDigest md = MessageDigest.getInstance("SHA-256");
                            byte[] hash = md.digest((password + salt).getBytes("UTF-8"));

                            // Convert the hash bytes to a hex string
                            StringBuilder hexString = new StringBuilder();
                            for (byte b : hash) {
                                hexString.append(String.format("%02x", b));
                            }
                            log.error("[BeforeOperation] NewPassword: " + hexString.toString());
                            // Replace the plain password with the salted hash
                            attrReq.setValue(hexString.toString());
                            jsonMap.put("newPassword", hexString.toString());
							String finalBody = JsonUtil.render(jsonMap);
							body.put("jsonBody", finalBody);
							requestEndPoint.setBody(body);

                    } catch (Exception e) {
                            logger.debug("Error in BeforeOperation rule: " + e.getMessage(), e);
                    }
                }
            }
        }
    }

} catch (Exception ex) {
    log.error("Rule - Modify Body: " + ex);
}
 
return requestEndPoint;

```

---

<div class="post-metadata">

**Author:** ![lampard08](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/lampard08/32/32646_2.png) [@lampard08](https://developer.sailpoint.com/discuss/u/lampard08)\
**Post date:** [December 4, 2025, 6:22pm UTC](https://developer.sailpoint.com/discuss/t/webservicebeforeoperation-rule-doesnt-seem-to-do-anything/190044/2 "2025-12-04T18:22:53Z")

</div>

> [@BFrescoKB](#):
>
> `Map jsonMap = JsonUtil.toMap(jsonBody);`

do you know what is the datatype for “jsonBody“?

try to do something like : String jsonBody = (String) body.get(“jsonBody”) before using in your jsonMap.

---

<div class="post-metadata">

**Author:** ![MattUribe](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/matturibe/32/20300_2.png) [@MattUribe](https://developer.sailpoint.com/discuss/u/MattUribe)\
**Post date:** [December 4, 2025, 6:37pm UTC](https://developer.sailpoint.com/discuss/t/webservicebeforeoperation-rule-doesnt-seem-to-do-anything/190044/3 "2025-12-04T18:37:09Z")

</div>

> [@BFrescoKB](#):
>
> ```auto
> log.error("Rule - Provisioning Body: running");
> 
> ```

Is your log output being generated in the ccg.log file? I can’t tell from your post if the rule is being executed, so checking for the logging would help to determine that. I assume that you attached the rule to the HTTP operation, but that’s a possible oversight that would prevent your code from being executed.

---

<div class="post-metadata">

**Author:** ![jrossicare](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@jrossicare](https://developer.sailpoint.com/discuss/u/jrossicare)\
**Post date:** [December 4, 2025, 9:53pm UTC](https://developer.sailpoint.com/discuss/t/webservicebeforeoperation-rule-doesnt-seem-to-do-anything/190044/4 "2025-12-04T21:53:23Z")

</div>

As Matt said above

1. Ensure you can see your rule writing to ccg.log, that way you know it is running
2. Add a line near the end to write out requestEndPoint, or at least the jsonBody, so you know you set the body correctly

---

<div class="post-metadata">

**Author:** ![BFrescoKB](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@BFrescoKB](https://developer.sailpoint.com/discuss/u/BFrescoKB)\
**Post date:** [December 5, 2025, 7:42am UTC](https://developer.sailpoint.com/discuss/t/webservicebeforeoperation-rule-doesnt-seem-to-do-anything/190044/5 "2025-12-05T07:42:33Z")

</div>

Hi Matt,

This was something I noticed as well it was not showing in the logs although I did have the connector log config set to debug specifically for this connector type (Webservices)

---

<div class="post-metadata">

**Author:** ![MattUribe](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/matturibe/32/20300_2.png) [@MattUribe](https://developer.sailpoint.com/discuss/u/MattUribe)\
**Post date:** [December 5, 2025, 10:24am UTC](https://developer.sailpoint.com/discuss/t/webservicebeforeoperation-rule-doesnt-seem-to-do-anything/190044/6 "2025-12-05T10:24:40Z")

</div>

You’re using `log.error` which should generate output to ccg.log without having to do anything to the log config. Can you confirm that your source config shows the “beforeRule” property for this HTTP operation with your rule set to the value?

Secondly, I noticed that line 37 contains `attrReq.setValue(hexString.toString());` but everywhere else you refer to attReq:

![image](https://global.discourse-cdn.com/sailpoint/original/3X/c/f/cf0a3edacecd48d7a9abaead3fedc0206e2e61ab.png)

It might be worth double checking what you are trying to do with attrReq.

Matt

---

<div class="post-metadata">

**Author:** ![mcheek](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/mcheek/32/23705_2.png) [@mcheek](https://developer.sailpoint.com/discuss/u/mcheek)\
**Post date:** [December 5, 2025, 12:01pm UTC](https://developer.sailpoint.com/discuss/t/webservicebeforeoperation-rule-doesnt-seem-to-do-anything/190044/7 "2025-12-05T12:01:01Z")

</div>

Just a sanity check here but you do have the rule attached to the operation in the config right?

> **[Connector executed Rules | SailPoint Developer Community](https://developer.sailpoint.com/docs/extensibility/rules/connector-rules#webservicebeforeoperation-rule)**
>
> Overview of connector-executed rules.

---

<div class="post-metadata">

**Author:** ![gmilunich](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gmilunich/32/8431_2.png) [@gmilunich](https://developer.sailpoint.com/discuss/u/gmilunich)\
**Post date:** [December 5, 2025, 2:38pm UTC](https://developer.sailpoint.com/discuss/t/webservicebeforeoperation-rule-doesnt-seem-to-do-anything/190044/8 "2025-12-05T14:38:58Z")

</div>

@BFrescoKB There is some good advice in this thread already. Please let us know what you try and the results so we can help further if needed.

> [@MattUribe](#):
>
> Secondly, I noticed that line 37 contains `attrReq.setValue(hexString.toString());` but everywhere else you refer to attReq:
> 
> ![image](https://global.discourse-cdn.com/sailpoint/original/3X/c/f/cf0a3edacecd48d7a9abaead3fedc0206e2e61ab.png)
> 
> It might be worth double checking what you are trying to do with attrReq.

As @MattUribe pointed out, I would correct this first, as this is the likely issue as to why you are not seeing a change if the rule is running.

> [@MattUribe](#):
>
> You’re using `log.error` which should generate output to ccg.log without having to do anything to the log config. Can you confirm that your source config shows the “beforeRule” property for this HTTP operation with your rule set to the value?

I would also check this if you are not getting any error messages out. @mcheek provided a link to the documentation for it.

To have the rule function:

- Make sure the latest rule code is deployed. You can verify this with the API.
- Make sure that the rule is configured as the BeforeRule for the HTTP Operation that it is supposed to run on. The Operations are indexed, so if you added/removed/reordered them, the index of your desired operation may have changed.
- Also, verify that you configured the correct operation type. You mentioned a password change, so verify that there is not another operation specifically for that operation (I did not check this myself.) This could be a reason that you are not seeing the logs or changes if you updated the wrong HTTP Operation’s BeforeRule.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [February 3, 2026, 2:39pm UTC](https://developer.sailpoint.com/discuss/t/webservicebeforeoperation-rule-doesnt-seem-to-do-anything/190044/9 "2026-02-03T14:39:53Z")

</div>

Closed on February 3, 2026, 2:39pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
