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--
    -----------------------------------