[Catalyst] Using Progressive realms when username and password
fields are all different
Tim Anderson
tja824 at gmail.com
Thu Jun 28 20:50:20 GMT 2012
Gavin,
Assuming you are using the Authentication plugin, you can define multiple
realm objects, each of which allows you to specify the columns to be used
for username and password. The documentation is pretty good on this one,
and it's working well for me.
http://search.cpan.org/~bobtfish/Catalyst-Plugin-Authentication-0.10020/lib=
/Catalyst/Plugin/Authentication.pm#CONFIGURATION
Does that help?
-Tim
On Thu, Jun 28, 2012 at 3:09 PM, Gavin Henry <gavin.henry at gmail.com> wrote:
> Hi all,
>
> I have three realms; customers, resellers and admins. Each auth table
> in these realms is not consistent and uses different username_filed
> and password_field names. I can't change this.
>
> Now the normal way is to do:
>
> if (
> $c->authenticate(
> {
> username =3D> $username,
> password =3D> $password
> },
> 'progressive_test'
> )
> )
> {
>
> This fails as no realms have username and password as the actual
> column names. I wanted DWIM here so when I pass in username the auth
> framework actually uses what I've set in my config using
> username_field and password_field like so:
>
> <customers>
> <credential>
> class Password
> password_type clear
> username_field useralias
> password_field uipass
> </credential>
> <store>
> class DBIx::Class
> user_model CustomerDB::Account
> </store>
> </customers>
>
> Ideas?
>
> --
> http://www.suretecsystems.com/services/openldap/
> http://www.surevoip.co.uk/api
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20120628/012f2=
20a/attachment.htm
More information about the Catalyst
mailing list