[cgiapp] Re: CGI::Application::Plugin::Authentication posthook

Rhesa Rozendaal perl at rhesa.com
Thu Feb 26 10:22:15 EST 2009


Terrence Brannon wrote:
> 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(@credentials)) {
> 
> 
> 
> I would like to see the call to verify_credentials provide the
> authentication object as well the cgiapp object.


See the documentation for new() in CAP::Authen::Driver: each driver is 
instantiated with the authen object and all the params from the config, (and 
not the cgiapp object as you thought).

You can access the authen object in the driver methods through the authen() 
method. I think that gives you enough rope to implement what you need.

Rhesa


More information about the cgiapp mailing list