<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>I have a need to call a CGI script that resides in cgi-bin from a Dancer application. My CGI application is simple:</div>
<div> </div>
<div>use CGI;</div>
<div>use JSON;</div>
<div> </div>
<div>my $cgi = new CGI();</div>
<div>print $cgi->header();</div>
<div> </div>
<div># Get the CSRF Token fnd the user rom cookie</div>
<div>my $CSRFToken = `/apps/www/cgi-bin/rsacookie -g -CSRFToken`;</div>
<div>my $user = `/apps/www/cgi-bin/rsacookie -g -user`;</div>
<div> </div>
<div>my %rec_hash = ('token'=>$CSRFToken, 'user'=>$user );</div>
<div>my $json = encode_json \%rec_hash;</div>
<div>print $json;</div>
<div> </div>
<div>The rsacookie is a binary that reads a client side cookie from an authenticated user. The Dancer application is secured by RSA’s web agent. The agent writes a cookie that can only be read by the rsacookie applet. Once I authenticate with the agent, the
above script works when called from the cgi-bin directory in a different browser tab/window, however when I call the script from within Dancer the rsacookie applet cannot find a valid cookie. Since the rsacookie applet requires to be ran in the CGI environment,
how can I call it from Dancer and maintain the CGI env? My dancer app is deployed with Plack/PSGI.</div>
<div> </div>
<div>Thanks.</div>
<div>Brent</div>
<div> </div>
<div> </div>
</span></font>
</body>
</html>