Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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

Replies are listed 'Best First'.
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?
Discipulus loose the tozzetto party!
[shmem]: .oO( addition of cookies for addiction to cookies )
[Lady_Aleena]: Other than my typos shmem. 8)
[shmem]: otherwise fine
[Discipulus]: tozzetti & vinsanto
[Lady_Aleena]: The whole line is push @line, ref($list_addition ) ? @$list_addition : $list_addition if $list_addition;
[Lady_Aleena]: And I forgot to do the array check, I'm such a doofus today.
[Lady_Aleena]: push @line, ref($list_addition ) eq 'ARRAY' ? @$list_addition : $list_addition if $list_addition; #trying again
[shmem]: Discipulus: yummy. I like those. Didn't have them for some time now, forgot the name. Should go get some...
[shmem]: Lasy_Aleena: correct, although for clarity I'd use an if() block, not a statement modifier

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2017-04-27 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (504 votes). Check out past polls.