jeteve has asked for the wisdom of the Perl Monks concerning the following question:
Hi !
I'd like to make a component that forces the user to authenticate again. I founded how to do it in php, this is simple as that:
<?php Header("WWW-Authenticate: Basic realm=\"My Realm\""); Header("HTTP/1.0 401 Unauthorized"); echo "You canceled authentication\n"; exit; ?>
But I cannot figured out how to do it in mason. I tried:
But it just make my browser display a void page.<%flags> inherit=> undef </%flags> <%perl> $m->autoflush(0); $m->clear_buffer(); $r->header_out->add("WWW-Authenticate" => 'Basic realm="RealmChain"'); $r->header_out->add("HTTP/1.0 401 Unauthorized" => ''); $r->send_http_header(); $m->abort(); </%perl>
Could anybody can help ?
Thanks ! Jerome.-- Nice photos of naked perl sources here !
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: [Mason] Sending right header to force http basic authentication
by simonm (Vicar) on Nov 26, 2005 at 03:51 UTC | |
by johnnywang (Priest) on Nov 26, 2005 at 20:47 UTC | |
by Anonymous Monk on Nov 27, 2005 at 02:28 UTC | |
by jeteve (Pilgrim) on Nov 28, 2005 at 09:38 UTC | |
Re: [Mason] Sending right header to force http basic authentication
by Anonymous Monk on Nov 28, 2005 at 21:43 UTC |
Back to
Seekers of Perl Wisdom