Skip to content

Instantly share code, notes, and snippets.

@josy1024
Created August 11, 2020 13:15
Show Gist options
  • Save josy1024/aa25372640c8ae5907bd5e85afcec8ce to your computer and use it in GitHub Desktop.
Save josy1024/aa25372640c8ae5907bd5e85afcec8ce to your computer and use it in GitHub Desktop.
print all ENV variables listet ind perl (OIDC_CLAIM_upn)
#!/usr/bin/perl
#
# place in /opt/otrs/bin/cgi-bin/azureadenv.pl
# call https://otrs.example.com/otrs/azureadenv.pl
# tested in #otrs6 #centos7
# reference: https://gist.github.com/josy1024/84853e1a72f5631f697ee324b93264fe
###
### printenv -- demo CGI program which just prints its environment
###
print "Content-type: text/plain; charset=iso-8859-1\n\n";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment