I've written a couple of different methods for http(s) authentication and looked at a few more. I'm using the cookie method currently, and it's working pretty well on the small (200 or so) user base that this tool supports.
I store a username and unix crypt password with a predetermined random string (example: erasei:-FOOBAR-:n31s9xyn4A) which is blowfish encrypted. That is what I store in the cookie. Then I store a set of username/crypted passwd combinations in a database and then compare the two crypted passwords, the random string, and syntax of the string during authentication. This method allows me to also store an access level in the database that will allow or disallow access to certain sections/pages of the tool based on username; something that htaccess doesn't allow us to do.
Also, I have looked into using mod_auth_msql but just haven't taken the time to fully research it yet.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.