Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

APM Policy to auto-connect VPN and then open webtop

rafaelbn
Cirrostratus
Cirrostratus

Hello Devs!

 

I'm trying to design a policy that a client would auto connect to the VPN and the webtop, with the internal apps links, did not have the VPN link. Let me show an image:

 

0691T000006BPqwQAG.jpg

 

I was able to configure the auto-connect part, but the "Corporate VPN" link is still showing on the webtop. I wish it was gone/hidden.

 

My policy is as follows:

 

0691T000006BPr6QAG.jpg

 

This policy is type SSL-VPN. I tested as type "All" and with this configuration:

 

0691T000006BPrQQAW.jpg

 

The configuration inside the "landing page" is as follows:

 

0691T000006BPrVQAW.jpg

 

 

Any thoughts? I just want to auto-connect on the VPN and show only the "Portal Green" icon. Corporate VPN should be hidden (or not even there).

 

Thanks! Rafael

1 REPLY 1

Hi Rafael,

 

You can use the APM Advanced Customization to make the '/Common/vpn-network-resource' button on your website to be hidden. To achieve this add the following javascript code to the footer.inc file of your access policy.

 

I've tested this code with version 14.1.0.3.

 

<script>
if (window.location.href.indexOf('vdesk/webtop.eui?webtop') > 0 ) {
    document.getElementById("webtop_favorites_inner_container2").style.display = "none";
    document.addEventListener('readystatechange', event => {
    
        const sleep = (milliseconds) => {
            return new Promise(resolve => setTimeout(resolve, milliseconds))
        }
   
        if (event.target.readyState === "interactive") {      //same as:  document.addEventListener("DOMContentLoaded"...   // same as  jQuery.ready
            //alert("All HTML DOM elements are accessible");
        }
   
        if (event.target.readyState === "complete") {
            //alert("Now external resources are loaded too, like css,src etc... ");
            sleep(500).then(() => {
                document.getElementById('/Common/vpn-network-resource').style.display = 'none';
                document.getElementById("webtop_favorites_inner_container2").style.display = "block";
            })
        }
   
    });
}
</script>