Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: [Mason] Sending right header to force http basic authentication

by simonm (Vicar)
on Nov 26, 2005 at 03:51 UTC ( #511817=note: print w/ replies, xml ) Need Help??


in reply to [Mason] Sending right header to force http basic authentication

See this section of the Mason documentation.

Perhaps semething like this:

<%perl> $m->autoflush(0); $m->clear_buffer(); $r->header_out->add("WWW-Authenticate" => 'Basic realm="RealmChain"'); $r->send_http_header(); $m->abort("401 Unauthorized"); </%perl>


Comment on Re: [Mason] Sending right header to force http basic authentication
Download Code
Re^2: [Mason] Sending right header to force http basic authentication
by johnnywang (Priest) on Nov 26, 2005 at 20:47 UTC
    This doesn't seem to work. Although abort() forced the correct status (401), it somehow removed the WWW-Authenticate header:
    $r->header_out->add("WWW-Authenticate" => 'Basic realm="RealmChain"'); $r->send_http_header();
      try : $r->err_header_out instead of $r->header_out
        Great ! It just work as I want with err_header !! Thx a lot.

        -- Nice photos of naked perl sources here !

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://511817]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2014-10-21 10:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (100 votes), past polls