[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Basic HTTP authentication

Henrik Steensland

11/29/2003 3:09:00 AM

Hi!

I'm having serious troubles getting Basic HTTP authentication to work.
This code:
r=Apache::request
r.auth_type='Basic'
r.auth_name='Testing'
r.status=401
r.note_auth_failure
r.send_http_header

produces a nice dialog in my browser for identification.
However, when I type a user name and password, the script doens't seem to
receive it.
r.user is for instance nil.

If I put a .htaccess and a .htpasswd file in the directory and answer with a
valid username and password, then my script is able to get the username in
r.user.

What am I doing wrong? Is there a simple way around this?
I would like to use the CGI-library if possible and I'm writing in ruby and
eruby. I don't want to extend mod_ruby (which I'm using) or something like
that.

Regards Henrik