Thanks, I would like to just confirm. if below configuration is fine. before i load and test through browser and i would like to add my webapp.pm configuration too. if that is causing an issue or not, if i have to modify or not

Please check below i ran as per your suggestion and output

:\Users\500000001\Documents>curl https://testchandan.com:5001/dev <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0 +, user-scalable=yes"> <title>Error 404</title> <link rel="stylesheet" href="/css/error.css"> </head> <body> <h1>Error 404</h1> <div id="content"> <h2>Page Not Found</h2><p>Sorry, this is the void.</p> </div> <div id="footer"> Powered by <a href="http://perldancer.org/">Dancer2</a>. </div> </body> </html>
#!/usr/bin/env perl use strict; use warnings; use FindBin; use lib "$FindBin::Bin/../lib"; use webapp; use Net::OAuth2::Client; use Dancer2; sub client { Net::OAuth2::Client->new( config->{'xxxxxxxxxxxxxxxxxxxxxx'}, config->{'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}, authorize_url => 'https://dev.oktapreview.com/oauth2/ +v1/authorize', access_token_url => 'https://dev.oktapreview.com/oauth2/v1/token +', response_type => 'code', redirect_uri => uri_for ("https://testchandan.com:5001/"), grant_type => 'authorization_code', scope => 'openid', state => '1234', ); } get 'https://testchandan.com:5001/42:site_id' => sub { redirect client(params->{site_id})->authorize; }; webapp->to_app;

webapp.pm

package webapp; use Dancer2; use Op; use Op1; use URI; our $VERSION = '0.1'; get '/' => sub { #&client1; template 'query2' => { 'title' => 'webapp' }; }; post '/'=> sub { my $r2 = Op::result4({OKTAUsersList => param('OKTA-Users-List'), Email => param('Email')}); template result2 => { title => 'webapp', result2 => $r2 } }; true;

In reply to Re^10: How can i capture the site_id in Dancer 2 app? by chandantul
in thread How can i capture the site_id in Dancer 2 app? 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.