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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |