Hi, Thanks you. I made it work after i assigned to LIST context but i have another question on result2.tt. I need to know the reason its not redirecting to result2.tt page post completing the job.
sub client ($){ $id = route_parameters->get('site_id'); $site_id = $id; my $redirect = uri_for("/got/$site_id"); $redirect =~ s,/dispatch\.cgi,,; my @scopeval = ('okta.users.read', 'okta.apps.read'); my $b = ( () = ('okta.users.read','okta.apps.read') ); my ($x,$y) = @scopeval; Net::OAuth2::Profile::WebServer->new ( client_id => 'xxxxxxxxxxxxxxxxxxxx', client_secret => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', authorize_url => 'https://dev.oktapreview.com/oauth2/v1/autho +rize', access_token_url => 'https://dev.oktapreview.com/oauth2/v1/token +', response_type => 'code', grant_type => 'authorization_code', scope => $x." ".$y, state => '1234', redirect_uri => $redirect ); }
My current webapp.pm with post actions
post '/' => sub { if (body_parameters->get('Userslist') eq 'Users-list' ) { $id = route_parameters->get('site_id'); my $site_id2 = params->{$id}; @access_token = client2($site_id2)->get_access_token($p); for my $i (0..$#access_token) { $accestoken = $access_token[$i]{NOA_access_token}; } push @accesstoken , $accestoken; my $email3 = param('Email'); print "My Email Value: " . $email3->[0] . "\n"; my $r2 = Op::api_call3(@accesstoken); my $r3 = Op::mailusersread({OKTAUsersList => param('Userslist'), + Email => $email3->[0]}); template result2 => { %common, result2 => $r3 } } elsif (body_parameters->get('Apps-list') eq 'Apps') { template query2 => { %common, button => 'Apps-list' } } my $_POST = "post"; #my %all_parameters = params; #print Dumper %all_parameters; my $namekey; my $namek; my @email1; my $email2; };
In reply to Re^22: Need to know the process to implement perl script into web application server.
by chandantul
in thread Need to know the process to implement perl script into web application server.
by chandantul
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |