use strict;
# use warning;

# Custom modules
use lib "/exlibris/primo/p4_1/pds/custom/lib";
use lib "/exlibris/primo/p4_1/pds/custom/vendor/lib";
# PDS program modules
use lib "/exlibris/primo/p4_1/pds/program";

# NYU Libraries modules
use NYU::Libraries::Util qw(parse_conf fix_target_url);
use NYU::Libraries::PDS;

# PDS Core modules
use PDSUtil qw(getEnvironmentParams);
use PDSParamUtil;

# New CGI
my $cgi = new CGI;
# Get Session Id
my $session_id = $cgi->cookie('PDS_HANDLE');
# Institute from URL
my $institute = PDSParamUtil::getAndFilterParam('institute');
# Get the current URL
my $current_url = $cgi->url(-query => 1);
# Get the auth code if it's there
my $auth_code = $cgi->param('code');
# Calling system is ezproxy
my $calling_system = "primo";
# Get the configuration
my $pds_directory = getEnvironmentParams('pds_directory');
my $conf = parse_conf("$pds_directory/config/pds/nyu.conf");
# Target URL is the current URL with the query
my $session_controller = NYU::Libraries::PDS::controller($conf, $institute,
$calling_system, $current_url, $session_id, $current_url);
# Logout
print $session_controller->sso($auth_code);
# Get the hell out of dodge
exit;

Create new custom script to atually run sso code on callback from oauth provider
Create new custom script to atually run sso code on callback from oauth provider
