Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: getting user basic_credentials in a SOAP::Lite Server

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


in reply to getting user basic_credentials in a SOAP::Lite Server

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: note [id://870861]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2026-02-17 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.