[Catalyst] Authentication not working as expected
ben.lavery at gmail.com
Tue Jan 11 16:09:13 GMT 2011
After installing Catalyst on an OpenIndiana virtual machine, I've been working through the Definitive Guide to Catalyst for the last few weeks and have been impressed with how smoothly most of it has gone.
I have, however, become unstuck at Chapter 6. The book explains how to create an application that uses some simple CRUD with user and role data, and uses authentication to prevent users updating other user's data.
I have a working application that allows one to create and read user data, but I can't figure out how to apply the authentication. The book says:
"When using the Authentication plug-in, as we showed in Chapter 3..."
I've gone back to Chapter 3 and followed the steps, but I'm not sure where I am supposed to put the "$c->authenticate".
If I place it in DBAuthTest::Controller::Root in a subroutine called "auto", every page on the site needs me to log in, but no matter what I put in the username and password fields it says that the data is invalid.
As such I have no idea where I have gone wrong, after Googling I can't find similar problems, or people who have had similar problems or implemented a similar system in a similar way.
I have looked at the source code provided on the publisher's site, but it doesn't include code for the whole chapter, and indeed seems to stop given code a page or two previous to where I am now...
I have uploaded a copy of my application to http://hashbang0.com/personal/DBAuthTest.tar.bz2 (~46K) which I hope help demonstrate where I am currently.
Many thanks for your time, I appreciate any help you can give,
More information about the Catalyst