The above script portion needs to be commented out
Problem Cause
The Device Cert Authentication Fails with Green Bubble theme because of the fact that we do not retain the NSC_EPAC Cookie since the above 2 request results in a 302 Redirect from the NetScaler which eventually resets the NSC_EPAC Cookie as shown below.
<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"><script type="text/javascript" src="/vpn/resources.js"></script><script type="text/javascript" language="javascript">var Resources = new ResourceManager("/vpn/resources/{lang}", "REDIRECTION_BODY");</script></head><body><span id="This object may be found "></span><a href="/vpn/index.html"><span id="here"></span></a><span id="Trailing phrase after here"></span><script type="text/javascript" language="javascript">Resources.Load();</script></body></html>
Since there is no NSC_EPAC Cookie in the subsequent request NetScaler Provides a new Cookie and expects the device cert to be sent again but we never do the device cert authentication again and use the new cookie in the POST /cgi/login request which results in 403 forbidden error as shown below.