Basic Authentication & Perl


OK, so I know how to set up the Apache web server to do basic authentication, that works. However, what I want to do now is to make a nice HTML page that a user can enter their credentials in and then log in instead of entering them in the standard box that web browsers pop up.

So, any ideas please on how I can take the data submitted from the form and use it (maybe through a Perl CGI) to establish a basic authentication session.

Help!!! Thanks a lot...I normally use cookie based authentication or just the basic authentication, but this is a bit differrent...though maybe there is a simple answer. :)



Count downloads from your site for free!
Oh yeah, I run a web hosting thing now too.


  • You can use CSS?Search for free web templates throung Google.Then use HTML/JS code with your perl script...
  • I hate js authenticastion, never secure enough for me :)

    Just have a perl script strip the arguments you want, then if they don't exist, make an html page with the form to login, if they exist, and are incorrect, write a page that has access denied, or something of the such, if the variables are correct(user is valid, password is valid, etc) write the appropriate content.
    [RED]Heero Yuy
    Perl Board Moderator
    Perl Semi-Expert[/RED]

  • Hi,

    Thanks for your response - I know of the solution you suggested, Heero, however I needed to protect an entire folder of content, possibly with several types of file. So files are placed in a folder and it's protected.

    I was looking to see if I could use Basic Auth for the project, but now a better solution seems to be to serve all pages through a Perl script which takes the filename as an argument. That gives me the level of time expiring access control and the decent login facilities like I was posting about here.

    Thanks everyone for the thoughts, and I'm still curious if a nicer logon page for use with basic authentication is possible.

    Take care,


    Count downloads from your site for free!
    Oh yeah, I run a web hosting thing now too.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!