For all of you mod_perl types out there:

How difficult would it be to write a PerlAuthenHandler that takes the 401-prompted username/password pair, create a timestamp file, and for each time the user requests a page, check the timestamp. If the timestamp is ever more than 15 minutes old (or some other time, set by configuration), instead of sending the requested document, send a login script requesting password again, and if the password is correct in the cgi form, then return the requested document?

I know this is convoluted and I have most of the other part, I'm just not sure how to spawn a subrequest in mod_perl that is part of the PerlAuthenHandler Authentication phase. It shouldn't be too hard to force Apache to parse the user input from a cgi script as part of the Authentication phase, but I'm not adept at mod_perl enough to do it. Here is a nice little flow chart type thingy:

_401 response_ -> request username password -> check timestamp -> \ if timestamp is too long, or no timestamp -> return a cgi -> if user i +nput \ checks out -> send the requested document.

Browsers are too flaky to rely on sending AUTH_REQUIRED to prompt a username/password entry.

Thanks,

jjhorner


In reply to mod_perl question on PerlAuthenHandler by jjhorner

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.