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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.