After performing an authChallenge, client navigates back to project Home screen

I am attempting to implement the Perspective Electronic Signature Framework that is provided in the Ignition Exchange: Ignition Exchange | Inductive Automation

I have been able to successfully run through the full process using the provided example project, however I am running into an issue after trying to implement this in my own project.

The flow is essentially kicked off with a “newESign” function. I have this tied to a button click event as shown below:

def runAction(self, event):
    from java.util import UUID
    id = str(UUID.randomUUID())
    
    idp = ""
    performRoles = ["bmsoper"]
    performSecurityLevels = []
    requireVerify = False
    verifyRoles = []
    verifySecurityLevels = []
    
    action = "TagChange"
    
    actionParameters = {
        "tagPath": "[PRVDR]CX Instrument Tags/" + self.view.params.InstrumentID + "/HH_Byp_Req",
        "oldValue": False,
        "newValue": True
        }
    
    ElectronicSignature.Utils.newESign(self, id, idp, performRoles, performSecurityLevels, requireVerify, verifyRoles, verifySecurityLevels, action, actionParameters)

This prompts an authChallenge, where the user must log in to have their roles compared against the required roles (performRoles). The issue that I’m facing currently is that after successfully logging in for the auth challenge, the project immediately navigates back to the home screen rather than continuing the E-Signature process on the relevant popup. I did not see this issue at all when using the example project.

Has anyone seen an issue like this or know of some project-specific configuration that could cause this behavior?

Additionally, this is the script use for the authChallenge:

def authChallenge(self, idr, authType, comments):
    obj = getPendingId(idr)
    if len(obj):
        pageId = self.page.props.pageId
        idp = obj["idp"]
        if idp == "":
            idp = None
        system.perspective.authenticationChallenge(idp=idp, forceAuth=True, payload={"id":idr, "authType":authType, "pageId":pageId, "comments":comments}, framing="popup")
    else:
        ElectronicSignature.Popup.showMessage("Action with id '%s' doesn't exist." % idr)

Hey,

I am facing the exact same issue.

I have noticed that the pageId changes after the authenticationChallenge, so sadly so far I haven't found a way to make this work.

The main issue is the pageId changing after the authenticationChallenge, has anyone faced this issue and found a solution ? :frowning:

EDIT : I should note that for some reason, the first time I do the authentication challenge, the pageId does NOT change, but when I do it a second time, it changes ?? How weird.

EDIT2: I thought maybe it was an issue introduced by 8.3 but I just tried on an 8.1 gateway and the behavior is the same...

Just to get the obvious out of the way, the system.perspective.authenticationChallenge call has its framing parameter set to "self".

After some more experimentations, I have narrowed it down to this being an issue because of the browser...

The pageId does not change after an authentication challenge in Firefox and Edge, but it does in Chrome...

Is this intended ?