Support Article
IAC: With No PRGateway authentication does not work
SA-10695
Summary
IAC gadget, which does not use PRGateway authentication, throws error. This issue occurs in Pega 7.1.7. The IAC gadgets worked correctly in PRPC 6.3 SP1.
Error Messages
Unknown Application <AppName> (or) verify the environment variable "/Authentication/RedirectGuests" is set to false if you are using gateway.
Steps to Reproduce
The below script replicates the IAC gadget internally.
<script>
pega.web.config.gatewayURL = "http://<host>/prweb/IAC";
pega.web.config.systemID = "default";
pega.web.config.appName = "SRWorkApp";
pega.web.config.thread = "STANDARD";
pega.web.config.encrypt=false;
pega.web.config.cmd.pegaAction = { "httpMethod": "POST" };
</script>
<div id="TesMe"
style="overflow:auto"
PegaGadget="TestMe"
PegaResize="stretch"
PegaA="createNewWork"
PegaA_className="PegaSample-Task"
PegaA_flowName="BasicProcess"
PegaA_model=""
PegaDefer="false"
PegaE_onLoad = "pegaLoad"
PegaE_onConfirm = "pegaConfirm"
PegaA_UserIdentifier="<user>@pega.com"
PegaA_params="">
</div>
Root Cause
The root cause of this problem is a backward compatibility issue starting with Pega 7.1.5, with the introduction of High Availability and Federated Case Management core changes.
Resolution
When not using the PRGateway application for IAC implementation in Pega 7.1.5 (and the later releases) you need to set /Authentication/RedirectGuests to false.
Add the following to prconfig.xml:
<env name="/Authentication/RedirectGuests" value="false"/>
You can also use a dynamic system setting instead of a prconfig change:
Owning Ruleset: Pega-Engine
Purpose: prconfig/Authentication/RedirectGuests/default
Value: false
A restart of the Pega JVM is required after the system setting change is made. This value is read at startup only.
Alternative Solution:
When not using PRGateway, the first request that reaches Pega is the call to the activity PRGatewayPing. You can override this function in the host application Javascript and call a custom PRGatewayPing<AppName> activity:
1. Copy the activity @baseclass.PRGatewayPing and rename to @baseclass.PRGatewayPing<AppName>
2. On the security tab of the activity set the "Requires Authentication" flag.
3. Add the following function to your gadget script:
<script>
pega.web.config.gatewayURL = "http://<host>/prweb/IAC";
pega.web.config.systemID = "default";
pega.web.config.appName = "SRWorkApp";
pega.web.config.thread = "STANDARD";
pega.web.config.encrypt=false;
pega.web.config.cmd.pegaAction = { "httpMethod": "POST" };
pega.web.mgr._pingGateway = function() {
try {
var pingCallbackObj = {
success: pega.web.mgr._pingGatewayCallback,
failure: pega.web.mgr._pingGatewayCallback
};
pega.util.Connect.asyncRequest("POST", pega.web.config.gatewayURL + "?pyActivity=PRGatewayPing<AppName>" , pingCallbackObj, "");
pega.web.mgr._logMsg("info", "", "Manager", "Pinged gateway to find gateway session cookie");
}
catch(e) { }
}
</script>
This allows you to trigger authentication during the first call to Pega.
Important Note:
Even when not using the PRGateway application at runtime you need to install the PRGateway in a development environment so you can properly generate the PegaInternetApplicationComposer.js. This is especially important when upgrading to a new version of Pega. This is not a static Javascript file, it is generated in a SOAP service call to the defined Pega host and is a static content bundle containing serveral core Rule-File-Text Javascript files that are specific to the version of Pega you are using.
Published August 21, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.