0
votes

enter image description hereAuthentication adapter throwing "Procedure invocation error" sometimes. Tried clearing cache and cookies but still the same. So we tried to login from different system for same user and it works. This is quite confusing as once we try with different ID in browser where issue occurred, it works and then it works with Member ID which has issue as well. Auth required is not coming in response when issue occurs.

we have tried to look into logs and found WorklightAuthenticationException from Authentication Adapter while trying security test procedure.

Authentication Adapter code: var result = WL.Server.invokeHttp(input);
WL.Logger.info("Authentication service : " + JSON.stringify(result));

authResponse = prepareJSONResponse(result,channelId);
WL.Logger.info('Formatted response -> ' + JSON.stringify(authResponse));    

if(result.isSuccessful == false){
    WL.Logger.info("Error: " + result.errorMessage);
    return onAuthRequired(null, "Error in connecting to server. Please try again later.");
}


if(typeof authResponse.errorMessage != 'undefined'){
    WL.Logger.info("Error is defined" +authResponse.errorMessage);
    return onAuthRequired(null, authResponse);
}


WL.Logger.info("Authentication service success: " + JSON.stringify(result));
WL.Logger.info("userIdentity Parameters: " + inputParams.CorpId);
var userIdentity = {
        userId: inputParams.CorpId,
        displayName: inputParams.CorpId,
       attributes: {
            foo: "bar"
        }
};
WL.Logger.info("userIdentity::"+JSON.stringify(userIdentity));
WL.Server.setActiveUser("SingleStepAuthRealm", userIdentity);


return {
        authRequired: false
};
2

2 Answers

0
votes

It is happening due to the requests going from one node to another node. Handled it in Load balancer to send requests to specific node based on cookies and post that it works fine.

0
votes

The description mentions about clearing cache and cookies and using browser.

Browser based environments are not supported in session independent mode. These work only in session dependent mode. As such, it is imperative that session based affinity be enabled to ensure the requests land in the same JVM for authentication state to be preserved.

More details can be found here : Session-independent mode