Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/MGRAST/lib/Analysis.pm
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ sub new {
my %srcid = map { $_, $srcs->{$_}{_id} } keys %$srcs;

# get mgrast token
my $mgrast_token = undef;
if ($Conf::mgrast_oauth_name && $Conf::mgrast_oauth_pswd) {
my $key = encode_base64($Conf::mgrast_oauth_name.':'.$Conf::mgrast_oauth_pswd);
my $rep = Auth::globus_token($key);
$mgrast_token = $rep ? $rep->{access_token} : undef;
}
#my $mgrast_token = undef;
#if ($Conf::mgrast_oauth_name && $Conf::mgrast_oauth_pswd) {
# my $key = encode_base64($Conf::mgrast_oauth_name.':'.$Conf::mgrast_oauth_pswd);
# my $rep = Auth::globus_token($key);
# $mgrast_token = $rep ? $rep->{access_token} : undef;
#}
#### changed because globus has hard time handeling multiple tokens
my $mgrast_token = $Conf::mgrast_oauth_token || undef;

# set json handle
my $agent = LWP::UserAgent->new;
Expand Down
31 changes: 18 additions & 13 deletions src/MGRAST/lib/JobDB/Job.pm
Original file line number Diff line number Diff line change
Expand Up @@ -921,12 +921,14 @@ sub fetch_browsepage_in_progress {
}

# get mgrast token
my $mgrast_token = undef;
if ($Conf::mgrast_oauth_name && $Conf::mgrast_oauth_pswd) {
my $key = encode_base64($Conf::mgrast_oauth_name.':'.$Conf::mgrast_oauth_pswd);
my $rep = Auth::globus_token($key);
$mgrast_token = $rep ? $rep->{access_token} : undef;
}
#my $mgrast_token = undef;
#if ($Conf::mgrast_oauth_name && $Conf::mgrast_oauth_pswd) {
# my $key = encode_base64($Conf::mgrast_oauth_name.':'.$Conf::mgrast_oauth_pswd);
# my $rep = Auth::globus_token($key);
# $mgrast_token = $rep ? $rep->{access_token} : undef;
#}
#### changed because globus has hard time handeling multiple tokens
my $mgrast_token = $Conf::mgrast_oauth_token || undef;

# set json handle
my $agent = LWP::UserAgent->new;
Expand Down Expand Up @@ -1294,13 +1296,16 @@ sub user_delete {

######## delete AWE / Shock ##########

# get mgrast auth
my $mgrast_token = undef;
if ($Conf::mgrast_oauth_name && $Conf::mgrast_oauth_pswd) {
my $key = encode_base64($Conf::mgrast_oauth_name.':'.$Conf::mgrast_oauth_pswd);
my $rep = Auth::globus_token($key);
$mgrast_token = $rep ? $rep->{access_token} : undef;
}
# get mgrast token
#my $mgrast_token = undef;
#if ($Conf::mgrast_oauth_name && $Conf::mgrast_oauth_pswd) {
# my $key = encode_base64($Conf::mgrast_oauth_name.':'.$Conf::mgrast_oauth_pswd);
# my $rep = Auth::globus_token($key);
# $mgrast_token = $rep ? $rep->{access_token} : undef;
#}
#### changed because globus has hard time handeling multiple tokens
my $mgrast_token = $Conf::mgrast_oauth_token || undef;

my @auth = ('Authorization', "OAuth ".$mgrast_token);

# get handles
Expand Down
14 changes: 8 additions & 6 deletions src/MGRAST/lib/WebPage/DownloadMetagenome.pm
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,14 @@ sub download {
my $size = $cgi->param('size');

# get mgrast token
my $mgrast_token = undef;
if ($Conf::mgrast_oauth_name && $Conf::mgrast_oauth_pswd) {
my $key = encode_base64($Conf::mgrast_oauth_name.':'.$Conf::mgrast_oauth_pswd);
my $rep = Auth::globus_token($key);
$mgrast_token = $rep ? $rep->{access_token} : undef;
}
#my $mgrast_token = undef;
#if ($Conf::mgrast_oauth_name && $Conf::mgrast_oauth_pswd) {
# my $key = encode_base64($Conf::mgrast_oauth_name.':'.$Conf::mgrast_oauth_pswd);
# my $rep = Auth::globus_token($key);
# $mgrast_token = $rep ? $rep->{access_token} : undef;
#}
#### changed because globus has hard time handeling multiple tokens
my $mgrast_token = $Conf::mgrast_oauth_token || undef;

my $response = undef;
my $agent = LWP::UserAgent->new;
Expand Down
14 changes: 8 additions & 6 deletions src/MGRAST/lib/resources/resource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ sub new {
};

# get mgrast token
my $mgrast_token = undef;
if ($Conf::mgrast_oauth_name && $Conf::mgrast_oauth_pswd) {
my $key = encode_base64($Conf::mgrast_oauth_name.':'.$Conf::mgrast_oauth_pswd);
my $rep = Auth::globus_token($key);
$mgrast_token = $rep ? $rep->{access_token} : undef;
}
#my $mgrast_token = undef;
#if ($Conf::mgrast_oauth_name && $Conf::mgrast_oauth_pswd) {
# my $key = encode_base64($Conf::mgrast_oauth_name.':'.$Conf::mgrast_oauth_pswd);
# my $rep = Auth::globus_token($key);
# $mgrast_token = $rep ? $rep->{access_token} : undef;
#}
#### changed because globus has hard time handeling multiple tokens
my $mgrast_token = $Conf::mgrast_oauth_token || undef;

# create object
my $self = {
Expand Down