I read the docs as i started this exercise and was aware of $r->auth_name, $r->auth_type, but since they did'nt work and I kept getting segfaults when using them I decided to try other routes. But anyways I'm glad that I read the docs right and that you can indeed set the AuthName using $r->auth_name.
As for the authenticate subroutine, I just copied that from the eagle book, just as a demonstration...
I'll upgrade my mod_perl from 1.2.1 -> latest and see if these work for me.
Thanks for the helpful insights and explanations Doug....I have seen the light ;)
-Carlos
Doug MacEachern wrote:
On Wed, 27 Sep 2000, Carlos Ramirez wrote:> my $authheader = 'Basic realm="'.$realm.'"';
>
> $r->header_out("WWW-Authenticate" ,$authheader);there's a cleaner way for that:
$r->auth_name($realm);
$r->note_basic_auth_failure;> $r->status(AUTH_REQUIRED);
no need for that.
> $r->send_http_header("text/html");
or this because..
> return AUTH_REQUIRED;
..apache will send the headers when you return an error
> return OK if $r->sub_request;
there's no Apache::sub_request method
> my ($res,$password) = $r->get_basic_auth_pw;
this will core dump if AuthName is not set in the configuration file.
not with the current cvs though, see previous message.> $r->note_basic_auth_failure;
this won't work right unless you've set $r->auth_name($val)
-- ----------------------------------------------------------------------- Carlos Ramirez + Boeing + Reusable Space Systems + 714.372.4181 ----------------------------------------------------------------------- - Someday I'll find that peer and reset his connection!