0 Replies Latest reply on Feb 7, 2013 8:14 PM by 989813

    Javascript errors using Checkpoint Mobile Access VPN: Workaround needed


      We are currently in the process of upgrading from APEX 3.2 to 4.2.1 at our organization. We are done with fixing all applications and tests have been successful so far.

      However we are facing one issue when we use applications by passing through a web proxy called Checkpoint Mobile Access VPN. The issue never occured in APEX 3.2 when using this proxy.

      Before explaining the issue here is a quick description of how this proxy works. I first authenticate through the proxy's login page. Once authenticated, there is a list of shortcuts I can choose to access our Portal.
      From the portal, I then have links to my APEX applications (APEX authentication is done with Oracle Single-sign-on).
      The proxy modifies all URLs to something like this:

      It also modifies HTML content and javascript libraries in order to work with its translated URLs (and maybe for some other reasons which I don't know). In javascript files, it replaces some functions and variables with some of its own.

      Now here is the issue. This javascript rewriting causes a syntax error to occur in desktop_all.min.js , more precisely in the code that concerns apex.security . This causes all apex and jquery functions to break.

      To investigate deeper, I removed the #APEX_JAVASCRIPT# placeholder in a template and included one by one all the uncompressed libraries that are used by desktop_all.min.js .
      This resolved the issue.

      After this I tried to include again all the same libraries but in their minified version. I then got the issue back. After searching a bit I realized that the issue is located in security.min.js .
      The minified version of the library has a syntax error but the uncompressed version works well.

      I analyzed the syntax error and it's caused by the proxy that closes a parenthesis at the wrong place. I've never had this kind of javascript rewriting issue before but the proxy software definitely failed in this case.
      I understand that the error is caused by the proxy software and has nothing to do with APEX. However I need to put a workaround in place since we have no choice of using the proxy in many situations.

      -Does anyone here ever got or heard about this issue? If yes, did you find a workaround?

      -I may have found my own workaround and would like to know your opinion on it:

      I took the uncompressed security.js file and minified it with a tool found on internet. The result code is different from the one bundled with APEX.
      I then refered to this new file in my template and had no error this time.
      What I finally did is edit desktop_all.min.js and replace the line concerning apex.security with my new file. It seems to work quite well.

      I know it's not a good approach to overwrite files provided by APEX like this but I would prefer this than including all the dozens of files.
      I would like to keep #APEX_JAVASCRIPT# so APEX continues controlling which libraries to include.

      What do you think about this? Maybe is there something similar that would be a better approach?

      Thanks in advance