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