in reply to A question of Catalyst

You'll want to read Catalyst::Plugin::Authentication::Internals. It gives a thorough explanation.