Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

getting user basic_credentials in a SOAP::Lite Server

by physi (Friar)
on Nov 02, 2010 at 13:14 UTC ( [id://868981]=perlquestion: print w/replies, xml ) Need Help??

physi has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I got a SOAP::Lite Server using

use SOAP::Transport::HTTP +trace => [qw(all)];

In the trace I find a lot of tracing stuff, but there is no chance to figure out the basic_credentials, which are sent to my server by i.e. SOAPUI with the username and password property.

Any hint of how to read this properties from the incoming SOAP message would be a real pleasure ;-)

Cheers, Christian
-----------------------------------
--the good, the bad and the physi--
-----------------------------------

Replies are listed 'Best First'.
Re: getting user basic_credentials in a SOAP::Lite Server
by Anonymous Monk on Nov 02, 2010 at 19:45 UTC
    basic credentials are part of HTTP headers, they're not part of SOAP/XML
      sure, you're right, but there might be a way to get this information out of the http-header, which envelopes the soap message ?
      Maybe you got any module hint ?
      Thx Christian
      -----------------------------------
      --the good, the bad and the physi--
      -----------------------------------
      
Re: getting user basic_credentials in a SOAP::Lite Server
by physi (Friar) on Nov 11, 2010 at 14:13 UTC
    After serveral tries, I've ended with this in SOAP::Transport::HTTP::handle:
    if (! $self->request->headers->authorization) { use HTTP::Headers; my $h = HTTP::Headers->new( Content_Type => 'text/html', 'WWW-Authenticate' => 'Basic realm="Secure Area"'); print "no AUTH\n"; return $self->response( HTTP::Response->new( 401,"401 Unauthorized",$h))};

    So now I'm able to send a 401-Message if there is no authorization in the header. The the client knows that it should send an authorization in the header and then I can check this in my Server-Code.

    Thanks for your suggestions.
    -----------------------------------
    --the good, the bad and the physi--
    -----------------------------------
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://868981]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-19 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found