#!/usr/bin/perl use strict; use warnings; print "Content-type: application/json\n\n"; my $status = 'ERROR'; my $errorstring = 'unknown'; my $username = ''; my $token = ''; if(defined $ENV{REMOTE_USER}) { $status = 'OK'; $errorstring = 'success'; $username = $ENV{REMOTE_USER}; $token = "this is cool!"; } else { $errorstring = 'no username defined'; } print "{\n"; print " 'status': '" . $status . "',\n"; print " 'errorstring': '" . $errorstring . "',\n"; print " 'username': '" . $username . "',\n"; print " 'token': '" . $token . "'\n"; print "}\n";