Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 musing on the Monastery: (6)
As of 2015-07-04 17:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls