[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem in Net::SAML example usage: reading POST data in combination with CGI

I have found a little problem in the perl example script for Net::SAML.
The example doesn't use the CGI module, however the way POST data are
read in seems to be incompatible with use CGI.
The example script (added my, to enable use strict):

my $qs = $ENV{'QUERY_STRING'};
$qs = <STDIN> if $qs =~ /o=P/; #this doesn't work for me after CGI->new

The symptom is that the query string returned is always empty and the script
returns to IDPselect screen
even after a valid session was established.

Instead, I am using the following code to read POST data (added a little
debugging output):

use CGI;
my $q = new CGI;

## . ##
my $qs = $ENV{'QUERY_STRING'};

if ($qs =~ /o=P/) {
    $qs = $q->query_string();
    warn "Query string read from STDIN and it is '$qs'\n";
    warn "empty Query string" unless $qs;
    warn "should have read ".$ENV{'CONTENT_LENGTH'}." bytes\n";

I propose that the example script be changed to work with CGI.pm


Michael Dondrup
Postdoctoral fellow
Sea Lice Research Centre/Department of Informatics
University of Bergen
Thormxhlensgate 55, N-5008 Bergen,

[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]