[dancer-users] Calling CGI Script From Dancer Application

Brent.N.Jones at wellsfargo.com Brent.N.Jones at wellsfargo.com
Thu Mar 3 19:44:54 GMT 2016


I have a need to call a CGI script that resides in cgi-bin from a Dancer application.  My CGI application is simple:

use CGI;
use JSON;

my $cgi = new CGI();
print $cgi->header();

# Get the CSRF Token fnd the user rom cookie
my $CSRFToken = `/apps/www/cgi-bin/rsacookie -g -CSRFToken`;
my $user = `/apps/www/cgi-bin/rsacookie -g -user`;

my %rec_hash = ('token'=>$CSRFToken, 'user'=>$user );
my $json = encode_json \%rec_hash;
print $json;

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.

Thanks.
Brent


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160303/d1a786cd/attachment.html>


More information about the dancer-users mailing list