summaryrefslogtreecommitdiff
path: root/authtoken.json
blob: 971b12e24d702981b5486bf98e53ff598c9f80a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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";