I think I figured out a two ways to do this. I can use the Generic driver and simply do some things after the driver authenticates if I write a custom sub... HOWEVER: I just looked at the code for CGIapp::Plugin::Authentication and noticed that it does not pass the authentication instance object to the driver. This means that the generic driver cannot manipulate that object in the authentication process or in a post-authentication process. Here is the line in CGI::Application::Plugin::Authentication in which the driver is called:
foreach my $driver ($self->drivers) { if (my $username = $driver->verify_credentials(@credential +s)) {
I would like to see the call to verify_credentials provide the authentication object as well the cgiapp object. Then it will be easy for me to store the user id in a subroutine written using the generic driver.

in the meantime

What I can do is subclass CGI::Application::Plugin::Authentication and add a userid method similar to the username method:
sub username { my $self = shift; $self->initialize; my $u = $self->store->fetch('username'); return $u; }

In reply to Re: CGI::Application::Plugin::Authentication posthook? by metaperl
in thread CGI::Application::Plugin::Authentication posthook? by metaperl

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.