#!/usr/bin/perl #This Perl script sends a secure HTTP POST Method data #to authenticate to the National Student Clearinghouse #This process only works using the POST Http method. #Username, Social Security Number, and Password are sent to the Clearinghouse #Site. print "Content-type: text/html\n\n"; #Perl Modules that are used in this script use strict; use CGI; #use HTTP::Request::Common qw(POST); use HTTP::Request; use HTTP::Response; use LWP::UserAgent; my $query = CGI->new(); my $username = $query->param('user_id'); my $ssn = $query->param('qu'); my $password = $query->param('password'); #Referral link that must match what Clearinghouse has recorded #that we are referring to them from. my $referer = 'https://lamp1s.isu.edu/cgi-bin/clearinghouse.pl'; #Secure Clearhousing Link that the student content is validated at. my $destURL = 'https://www.studentclearinghouse.org/secure_area/ref_students.asp'; #Creating Virtual server connection my $ua = new LWP::UserAgent; #Defining the browser were using $ua->agent('Mozilla/5.0 [en] (Windows NT 5.1; U)'); #Create the HTTP POST Secure URL link my $request = HTTP::Request->new(POST => $destURL); $request->content_type('application/x-www-fo rm-urlencoded');$request->content('user_id='.$username.'&password='.$password.'&qu='.$ssn);$requ est->referer($referer); #Turning on redirect with the POST Method only push @{$ua->requests_redirectable}, 'POST'; #Submitting the link for verfication my $response = $ua->request($request); #Verifying if everthing worked, if not #an error will be generated back to the browser. #If everything worked Student should be #logged into the National Student Clearing House Site if (! $response->is_success) { print < Transcript Verification Request

Error submitting to Student Clearinghouse

EOF print $ua->is_protocol_supported( 'https' ). "
"; print < EOF } else { print $response->content; } exit;