[Melbourne-pm] SSO authentication

Toby Wintermute tjc at wintrmute.net
Fri May 23 01:46:15 PDT 2014


You've blanked out the actual URL you're trying to GET, so we can't
check.. but are you sure that it's not redirecting to an HTTPS URL,
and thus triggering the SSL-related comments from LWP?

I don't suppose you've tried following the hints given to you by LWP,
that you quoted in your post?
ie. Either installing the Mozilla CA package, or pointing to an
existing CA package, or disabling CA verification altogether.

On 23 May 2014 00:09, Mithun Radhakrishnan <mithunr2003 at gmail.com> wrote:
>
> I need to do a SSO authentication and do a HTTP GET request for a web
> service.
>
> I get the below response content on doing a basic authentication using LWP.
> I am trying to automate the testing of some of the web services. But the
> basic authentication using Mozilla(browser) REST client works properly and
> it is giving the expected response.
>
> Do we need to do a different authentication mechanism in LWP for SSO?
>
>
> "Can't verify SSL peers without knowning which Certificate Authorities to
> trust
>
> This problem can be fixed by either setting the PERL_LWP_SSL_CA_FILE
> envirionment variable or by installing the Mozilla::CA module.
>
> To disable verification of SSL peers set the PERL_LWP_SSL_VERIFY_HOSTNAME
> envirionment variable to 0.  If you do this you can't be sure that you
> communicate with the expected peer.
> "
>
>
> -------------------------------------------------------------------------------------------
> my $method = 'GET';
> my $uri    = 'http://xxxx';
> my $username = 'xxx';
> my $password = 'xxxx';
>
> my $cookie_location = "/tmp/cookie";    # This must be read/write
> my $ua = LWP::UserAgent->new(keep_alive => 1);
> $ua->default_header( 'Accept' => '*/*' );
> $ua->cookie_jar(
>     {
>         file           => $cookie_location,
>         autosave       => 1,
>         ignore_discard => 1
>     }
> );
>
> my $request = HTTP::Request->new( $method, $uri );
> $request->authorization_basic( $username, $password );
> my $response = $ua->request($request);
>
> ---------------------------------------------------------------------------------
>
>
> Regards
> Mithun
>
> _______________________________________________
> Melbourne-pm mailing list
> Melbourne-pm at pm.org
> http://mail.pm.org/mailman/listinfo/melbourne-pm



-- 
Turning and turning in the widening gyre
The falcon cannot hear the falconer
Things fall apart; the center cannot hold
Mere anarchy is loosed upon the world


More information about the Melbourne-pm mailing list