use strict;
use warnings;
use LWP::UserAgent;
use HTML::Entities;
use HTTP::Request;
use Data::Dumper;
use HTTP::Headers;
use URI;
my $ua = LWP::UserAgent->new();
my $uri = URI->new('https://synchronydev.oktapreview.com/oauth2/v1/aut
+horize');
$uri->query_form(client_id => 'xxxxxxxxxxxxxxxxxx',response_type=>'
+code', scope=>'openid',redirect_uri=>'https://testchandan.com:5001/',
+state=>'1234', nonce=>'UBGW');
print Dumper "$uri\n";
my $response1 = $ua->get($uri);
my $responsecode = $response1->code() ;
my $responsecontent = $response1->content();
print "$responsecode\n";
print "$responsecontent\n";
unless($response1->is_success(),$response1->code) {
die($response1->code, "\n", $response1->content, "\n");
}
post sign in - I have received the below headers and i will need to capture the code value.
Request URL: https://testchandan.com:5001/?code=E1XqzJxB-OMLscNAJtWZG1
+_wthVln5UfNIWwAS5YDU8&state=1234
Request Method: GET
Status Code: 200 OK
Remote Address: 10.10.1.20:5001
Referrer Policy: strict-origin-when-cross-origin
o) Chrome/88.0.4324.104 Safari/537.36
code: E1XqzJxB-OMLscNAJtWZG1_wthVln5UfNIWwAS5YDU8
state: 1234
|