balakrishna_bk has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I have special character '<' in my password and I get error when i try to login. I tried the following options to encode my password, but still fails
1. add '\' in front of '<' in password 2. passing username and password in url https://username:'pass<1234'@system.test.com' 3. used uri_escape from URI::Escape uri_escape($pwd) 4. encoded using base64 $r->header( "Content-Type" => "application/soap+xml;charset=UTF-8", "S +OAPAction" => "", "Authorization" => "Basic U1BDX1NJVEUyNFg3OjNmUlRMb +2NjQmZmWHk=" ); sub do_webservice { my ( $weburl, $usr, $password, $webxml ) = @_; print FD "\nXML: \n$webxml\n"; print FD "\nURL: \n$weburl\n"; my $ua = LWP::UserAgent->new(); $ua->ssl_opts( verify_hostnames => 0 ); my $r = HTTP::Request->new( "POST", $weburl ) or warn "POST FAIL +ED:$!\n";; $r->header( "Content-Type" => "application/soap+xml;charset=UTF- +8", "SOAPAction" => "" ); $r->authorization_basic( $usr, $password ); $r->content($webxml); my $response = $ua->request($r); print FD "START Dumper of $response\n"; print FD Dumper $response; print FD "END Dumper of $response\n"; print FD "DEBUG: Response is $response \n"; return $response; }
Any help is appreciated. Regards, Bala
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Special character in authorization_basic
by Yary (Pilgrim) on Feb 10, 2016 at 12:59 UTC | |
by balakrishna_bk (Initiate) on Feb 11, 2016 at 03:35 UTC | |
by hippo (Archbishop) on Feb 11, 2016 at 09:53 UTC | |
by balakrishna_bk (Initiate) on Feb 12, 2016 at 08:19 UTC | |
by hippo (Archbishop) on Feb 12, 2016 at 09:32 UTC |