Hello, I would like to redirect to our Authorization server login page once we hit http://testchandan.com:5001 in order to get authorization code. I am wondering how can i redirect to Authorization page by modifying the app.psgi. I was unable to find proper module to configure Oauth get request for authorization code in app.psgi. I am using Dancer 2 webapp, Can you please let me know?

#!/usr/bin/env perl use strict; use warnings; use Plack::Middleware; use webapp; use Plack::Builder; use Authen::Simple::ActiveDirectory; use Authen::Simple::HTTP; use Log::Log4perl; my $ad = Authen::Simple::ActiveDirectory->new( #host => 'ldaps//ad.abc.com', host => 'ldap//ad.abc.com', #basedn => 'dc=ad,dc=abc,dc=com', principal => 'ad.abc.com', timeout => '60', log => Log::Log4perl->get_logger('Authen::Simple::ActiveDirectory' +) ); my $ua = LWP::UserAgent->new(); $ua->proxy([ 'http' ], 'http://proxy.glb.abc.com:8080'); my $uri = URI->new('https://dev.preview.com/oauth2/default/v1/authori +ze'); $uri->query_form(client_id => 'xxxxxxxxxxxxxxxxxxx',response_type=> +'code', scope=>'myid',redirect_uri=>'http://testchandan.com:5001',sta +te=>'1234', nonce=>'UBGW'); #$ua->get($uri); builder { enable "Auth::Basic", authenticator => $ad; my ( $username, $password ) = @_; webapp->to_app; }; =begin comment builder { enable "Plack::Middleware::Auth::OIDC::ProtectedResource", data_handler => "webapp::DataHandler", error_uri => q{http://example.org/error/description}; enable "Plack::Middleware::JSONP"; enable "Plack::Middleware::ContentLength"; webapp->to_app; }; =end comment =cut

In reply to Re^5: Need to resolve the API call query by chandantul
in thread Need to resolve the API call query 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.