[Catalyst] Catalyst Redirect to https

2010-03-25 Thread Octavian Rasnita
Hi,

In a catalyst action accessed using https I do:

if ($c->authenticate({username => $username, password => $password, active => 
1})) {
  $c->res->redirect($c->uri_for_action("/index"));
}

It redirects to / URI of the site, but using http, not https as in the request 
for the current page.

Isn't $c->uri_for_action() able to see that the current URI uses https and 
continue to use it or this revert to http is intentional?

Thanks.

--
Octavian



__ Information from ESET NOD32 Antivirus, version of virus signature 
database 4973 (20100325) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

___
List: Catalyst@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/


[Catalyst] Taking advantage of idle periods by performing some action(s)

2010-03-25 Thread Ido Perlmuter
Hi everyone.

I'm looking for direction on how to possibly implement a feature in a
Catalyst app that automatically performs some action, or actions, when the
app is idle and hasn't been accepting requests (either none or some small
number). For example, let's say I want my app to take advantage of such
situations by indexing documents to KinoSearch, rebuilding a sitemap.xml
file, whatever.

The idea is, basically, to define a situation in which your app can be
considered idle (no requests in the past 3 minutes, only 2 requests per
minute, I don't know), and then forcing the app to maybe create a fake
request to a Private action that does whatever it is I want. It might also
be necessary to force the action to "break out early" in case the app starts
receiving more requests and can no longer be considered idle.

Thing is, I do not want (if possible) to implement a job queue such as
TheSchwartz. I do not want an outside worker, I want my app to be the
worker, and let it decide by itself what to do instead of take jobs from a
queue.

Any help will be appreciated, I still can't think of a way to do this.

Thanks a lot,
Ido.
___
List: Catalyst@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/


Re: [Catalyst] Taking advantage of idle periods by performing some action(s)

2010-03-25 Thread Kiffin Gish
Check out Catalyst::Plugins::Scheduler for some ideas.

On Thu, 2010-03-25 at 14:30 +0200, Ido Perlmuter wrote:
> Hi everyone.
> 
> I'm looking for direction on how to possibly implement a feature in a
> Catalyst app that automatically performs some action, or actions, when
> the app is idle and hasn't been accepting requests (either none or
> some small number). For example, let's say I want my app to take
> advantage of such situations by indexing documents to KinoSearch,
> rebuilding a sitemap.xml file, whatever.
> 
> The idea is, basically, to define a situation in which your app can be
> considered idle (no requests in the past 3 minutes, only 2 requests
> per minute, I don't know), and then forcing the app to maybe create a
> fake request to a Private action that does whatever it is I want. It
> might also be necessary to force the action to "break out early" in
> case the app starts receiving more requests and can no longer be
> considered idle.
> 
> Thing is, I do not want (if possible) to implement a job queue such as
> TheSchwartz. I do not want an outside worker, I want my app to be the
> worker, and let it decide by itself what to do instead of take jobs
> from a queue.
> 
> Any help will be appreciated, I still can't think of a way to do this.
> 
> Thanks a lot,
> Ido.
> 
> ___
> List: Catalyst@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/


-- 
Kiffin Gish 
Gouda, The Netherlands


___
List: Catalyst@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/


Re: [Catalyst] Taking advantage of idle periods by performing some action(s)

2010-03-25 Thread Bill Moseley
On Thu, Mar 25, 2010 at 5:30 AM, Ido Perlmuter  wrote:

> I'm looking for direction on how to possibly implement a feature in a
> Catalyst app that automatically performs some action, or actions, when the
> app is idle and hasn't been accepting requests (either none or some small
> number). For example, let's say I want my app to take advantage of such
> situations by indexing documents to KinoSearch, rebuilding a sitemap.xml
> file, whatever.
>

Doesn't really seems like the job of a Catalyst app to run background tasks.

What's wrong with cron?  It can run a script and see if the machine's load
is low (or some other measurement) before deciding to run.



> Thing is, I do not want (if possible) to implement a job queue such as
> TheSchwartz. I do not want an outside worker, I want my app to be the
> worker, and let it decide by itself what to do instead of take jobs from a
> queue.
>

Yes, you do want an outside worker.  It can be part of  your app, but it
should be separate from Catalyst.  Put it in a model class.  Ok, sure you
could have cron run App/script/app_test.pl /path/to/action but why load all
of Catalyst just to run some code in your application?




-- 
Bill Moseley
mose...@hank.org
___
List: Catalyst@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/


Re: [Catalyst] Taking advantage of idle periods by performing some action(s)

2010-03-25 Thread Ido Perlmuter
Kiffin, thanks for the heads up about Plugin::Scheduler, seems to fit my
needs quite good.

Bill, an outside worker is actually the heavier solution in this case,
because I'm not loading my Catalyst app just to run some code, my Catalyst
app is _always_ running (for the matter, it's a FastCGI process that is the
backend of my websites). Starting an external worker that needs to connect
to the schema and try hard to figure out what's going on in the already
running Catalyst process is pointless, hard to implement and kinda ugly (in
my opinion). My app is already up and running, why start a new process? it's
those idle moments when nobody seems to visit my stupid websites that I want
the app to employ itself with some useful tasks.

The location of the logic the app will be executing in those idle moments
(either the model or the controller itself) is irrelevant here. The
controller, which will be automatically requested at some idle moment, will
pass the work to the model...

Thanks,
Ido.

On Thu, Mar 25, 2010 at 4:01 PM, Bill Moseley  wrote:

>
>
> On Thu, Mar 25, 2010 at 5:30 AM, Ido Perlmuter  wrote:
>
>> I'm looking for direction on how to possibly implement a feature in a
>> Catalyst app that automatically performs some action, or actions, when the
>> app is idle and hasn't been accepting requests (either none or some small
>> number). For example, let's say I want my app to take advantage of such
>> situations by indexing documents to KinoSearch, rebuilding a sitemap.xml
>> file, whatever.
>>
>
> Doesn't really seems like the job of a Catalyst app to run background
> tasks.
>
> What's wrong with cron?  It can run a script and see if the machine's load
> is low (or some other measurement) before deciding to run.
>
>
>
>> Thing is, I do not want (if possible) to implement a job queue such as
>> TheSchwartz. I do not want an outside worker, I want my app to be the
>> worker, and let it decide by itself what to do instead of take jobs from a
>> queue.
>>
>
> Yes, you do want an outside worker.  It can be part of  your app, but it
> should be separate from Catalyst.  Put it in a model class.  Ok, sure you
> could have cron run App/script/app_test.pl /path/to/action but why load
> all of Catalyst just to run some code in your application?
>
>
>
>
> --
> Bill Moseley
> mose...@hank.org
>
> ___
> List: Catalyst@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/
>
>
___
List: Catalyst@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/


Re: [Catalyst] Taking advantage of idle periods by performing some action(s)

2010-03-25 Thread Peter Karman
Ido Perlmuter wrote on 03/25/2010 10:04 AM:
> Kiffin, thanks for the heads up about Plugin::Scheduler, seems to fit my
> needs quite good.
>

> Starting an external worker that needs to connect to the schema and
> try hard to figure out what's going on in the already running Catalyst
> process is pointless, hard to implement and kinda ugly (in my opinion).

I won't argue with the ugly part, since taste is personal, but if it is
hard to connect to the schema and start background processes, I suspect
your application architecture needs a re-think. Catalyst is for gluing
HTTP onto an application. If you're doing more than that, the
architecture needs reconsideration.

> My app is already up and
> running, why start a new process? it's those idle moments when nobody
> seems to visit my stupid websites that I want the app to employ itself
> with some useful tasks.

Scheduler is triggered on requests. So by definition your app is not idle.

Bill's point is that if you have non-HTTP request cycle actions as part
of your business model, they don't belong in your Catalyst app. That
doesn't mean you can't reuse parts of the code in your Catalyst app, but
that the Catalyst engine itself doesn't need to be involved.

cron is your friend.

-- 
Peter Karman  .  http://peknet.com/  .  pe...@peknet.com

___
List: Catalyst@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/


Re: [Catalyst] Taking advantage of idle periods by performing some action(s)

2010-03-25 Thread Kiffin Gish
I believe that what Ido is trying to get at is the fact that the
triggered actions are not completely independent of the application.

Putting them in crontab is fine for running processes at predictable
times, but this is no good if the application needs some kind of control
over them.

Hooking them up to only occur when triggered by HTTP requests should not
be a limitation (reminds me of the good old days programming Windows and
hoping for cooperative yielding to pass me a WM_PAINT message in time).

Catalyst is a very flexible and therefore powerful framework, so let's
use it this way.

On Thu, 2010-03-25 at 10:32 -0500, Peter Karman wrote:
> Ido Perlmuter wrote on 03/25/2010 10:04 AM:
> > Kiffin, thanks for the heads up about Plugin::Scheduler, seems to fit my
> > needs quite good.
> >
> 
> > Starting an external worker that needs to connect to the schema and
> > try hard to figure out what's going on in the already running Catalyst
> > process is pointless, hard to implement and kinda ugly (in my opinion).
> 
> I won't argue with the ugly part, since taste is personal, but if it is
> hard to connect to the schema and start background processes, I suspect
> your application architecture needs a re-think. Catalyst is for gluing
> HTTP onto an application. If you're doing more than that, the
> architecture needs reconsideration.
> 
> > My app is already up and
> > running, why start a new process? it's those idle moments when nobody
> > seems to visit my stupid websites that I want the app to employ itself
> > with some useful tasks.
> 
> Scheduler is triggered on requests. So by definition your app is not idle.
> 
> Bill's point is that if you have non-HTTP request cycle actions as part
> of your business model, they don't belong in your Catalyst app. That
> doesn't mean you can't reuse parts of the code in your Catalyst app, but
> that the Catalyst engine itself doesn't need to be involved.
> 
> cron is your friend.
> 


-- 
Kiffin Gish 
Gouda, The Netherlands


___
List: Catalyst@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/


Re: [Catalyst] Taking advantage of idle periods by performing some action(s)

2010-03-25 Thread Bill Moseley
On Thu, Mar 25, 2010 at 8:04 AM, Ido Perlmuter  wrote:

> Kiffin, thanks for the heads up about Plugin::Scheduler, seems to fit my
> needs quite good.
>

I used that plugin in an early application that is still running.  I've
never spent the time to debug, but I've had times when it seems an error in
one "job" resulted in other jobs not running.  So, if you really want to
send requests to your running Catalyst application then I'd use cron and
lwp/wget instead of the plugin.


-- 
Bill Moseley
mose...@hank.org
___
List: Catalyst@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/


[Catalyst] Re: Which C::View::PDF should I use?

2010-03-25 Thread Aristotle Pagaltzis
* Wade Stuart  [2010-03-22 22:35]:
> On Tue, Mar 16, 2010 at 2:53 PM, Aristotle Pagaltzis wrote:
> > * Adam Sjøgren  [2010-03-16 18:15]:
> > > An alternative could perhaps be CutyCapt:
> > >
> > > * http://cutycapt.sourceforge.net/
> >
> > It requires an X11 server, so it isn’t.
> >
> Xvfb has been the solution to this forever.

And how is Xvfb (which is an X11 server) a solution the problem
of requiring an X11 server?

Regards,
-- 
Aristotle Pagaltzis // 

___
List: Catalyst@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/


Re: [Catalyst] Catalyst Redirect to https

2010-03-25 Thread Christiaan Kras

You can use Catalyst::Plugin::RequireSSL to force https.

Although I think https should be used by your method if that's what the 
user access the app with.



Christiaan



Octavian Rasnita schreef:

Hi,
 
In a catalyst action accessed using https I do:
 
if ($c->authenticate({username => $username, password => $password, 
active => 1})) {

  $c->res->redirect($c->uri_for_action("/index"));
}
It redirects to / URI of the site, but using http, not https as in the 
request for the current page.
 
Isn't $c->uri_for_action() able to see that the current URI uses https 
and continue to use it or this revert to http is intentional?
 
Thanks.
 
--

Octavian


__ Information from ESET NOD32 Antivirus, version of virus 
signature database 4973 (20100325) __


The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


___
List: Catalyst@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/
  
___
List: Catalyst@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/


Re: [Catalyst] Catalyst Redirect to https

2010-03-25 Thread Octavian Rasnita
Hi,

Sorry but I haven't provided the correct information.
The problem is that I use a load balancer (Apache mod_proxy_balancer) and it 
gets the https request, however it passes the request to the backend Apache - 
mod_perl based servers using http.

How do you do $c->res->redirect in cases like this?

The front end server listens to the ports 80 and 443 and the back end servers 
to the ports 81 and 82 (they are on the same machine for the moment).

The back end servers don't know if the current request is an http or an https 
one and on each redirect, they do the redirection using the http scheme.
(I have also set the configuration option using_frontend_proxy to true.)


Also, because the back end servers receive only http requests, $c->req->secure 
is always equal to 0.
I have read that I can set the HTTPS environment variable to "On" and I put the 
following line in the configuration file of the load balancer Apache server in 
the virtualhost that handles SSL requests:

SetEnv HTTPS On

But nothing changes and $c->req->secure is still equal to 0, and the redirects 
are still done using the https scheme, so I am doing something wrong for sure.

Do I need to have special virtualhosts on the back end servers that handle the 
requests that came using https and set the HTTPS environment variable on those 
virtualhosts? Or how can I let the Catalyst app know if the requests to the 
load balancer were using https?

Please tell me what should I do or where can I find more information about 
using a load balancer with https and Catalyst.

Thanks.

Octavian

From: "Christiaan Kras" 
> You can use Catalyst::Plugin::RequireSSL to force https.
> 
> Although I think https should be used by your method if that's what the 
> user access the app with.
> 
> 
> Christiaan
> 
> 
> 
> Octavian Rasnita schreef:
>> Hi,
>>  
>> In a catalyst action accessed using https I do:
>>  
>> if ($c->authenticate({username => $username, password => $password, 
>> active => 1})) {
>>   $c->res->redirect($c->uri_for_action("/index"));
>> }
>> It redirects to / URI of the site, but using http, not https as in the 
>> request for the current page.
>>  
>> Isn't $c->uri_for_action() able to see that the current URI uses https 
>> and continue to use it or this revert to http is intentional?
>>  
>> Thanks.
>>  
>> --
>> Octavian
>>
>>
>> __ Information from ESET NOD32 Antivirus, version of virus 
>> signature database 4973 (20100325) __
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>> 
>>
>> ___
>> List: Catalyst@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/
>>   
>





> ___
> List: Catalyst@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/
>

___
List: Catalyst@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/


[Catalyst] Catalyst 5.80021

2010-03-25 Thread gordon
Dear List

I have just updated to Catalyst 5.80021 from 5.8002 and now I am seeing
the following error when I restart my application.

Use of uninitialized value in list assignment at
/usr/local/share/perl/5.8.8/Catalyst/Engine/HTTP.pm line 371.

I get 8 of these in one go.

Can someone tell me if this is a known bug, or tell me how I can resolve
the issue?

Regards

Gordon



___
List: Catalyst@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/


Re: [Catalyst] Catalyst 5.80021

2010-03-25 Thread J. Shirley
On Thu, Mar 25, 2010 at 2:08 PM,   wrote:
> Dear List
>
> I have just updated to Catalyst 5.80021 from 5.8002 and now I am seeing
> the following error when I restart my application.
>
> Use of uninitialized value in list assignment at
> /usr/local/share/perl/5.8.8/Catalyst/Engine/HTTP.pm line 371.
>
> I get 8 of these in one go.
>
> Can someone tell me if this is a known bug, or tell me how I can resolve
> the issue?
>

That isn't actually an error, it's simply a warning message.

I'm not certain of the fix, based on the limited information given,
but I would bet your scripts are out of date.  When you start your
server (using the dev server) do you get a message about upgrading the
script?

-J

___
List: Catalyst@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/


Re: [Catalyst] Catalyst Redirect to https

2010-03-25 Thread Bill Moseley
2010/3/25 Octavian Rasnita 

>
> The back end servers don't know if the current request is an http or an
> https one and on each redirect, they do the redirection using the http
> scheme.
> (I have also set the configuration option using_frontend_proxy to true.)
>
>
> Also, because the back end servers receive only http requests,
> $c->req->secure is always equal to 0.
> I have read that I can set the HTTPS environment variable to "On" and I put
> the following line in the configuration file of the load balancer Apache
> server in the virtualhost that handles SSL requests:
>
> SetEnv HTTPS On
>

Does that header get to Catalyst?  Obviously, check that first.

I have this in  a "after 'prepare_headers'":

   $res->secure( 1 ) if lc( $req->header( 'Https' ) || '' ) eq 'on';

The load balancer sends all traffic to the same port.  The load balancer
sets that header for SSL traffic.

I used to send to two different ports and then detect SSL based on the port
number.  Same result either way.




-- 
Bill Moseley
mose...@hank.org
___
List: Catalyst@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/


Re: [Catalyst] Re: Which C::View::PDF should I use?

2010-03-25 Thread Wade Stuart
On Mar 25, 2010, at 12:01 PM, Aristotle Pagaltzis 
wrote:

> * Wade Stuart  [2010-03-22 22:35]:
>> On Tue, Mar 16, 2010 at 2:53 PM, Aristotle Pagaltzis > >wrote:
>>> * Adam Sjøgren  [2010-03-16 18:15]:
 An alternative could perhaps be CutyCapt:

 * http://cutycapt.sourceforge.net/
>>>
>>> It requires an X11 server, so it isn’t.
>>>
>> Xvfb has been the solution to this forever.
>
> And how is Xvfb (which is an X11 server) a solution the problem
> of requiring an X11 server?

It is a virtual frame buffer that allows x11 requiring apps to run
without a full display/head.  What besides that is your issue around
the  x11 requirement on servers?


>
> Regards,
> --
> Aristotle Pagaltzis // 
>
> ___
> List: Catalyst@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/

___
List: Catalyst@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/


Re: [Catalyst] Re: Which C::View::PDF should I use?

2010-03-25 Thread Peter Edwards
On Mar 25, 2010, at 12:01 PM, Aristotle Pagaltzis 
> And how is Xvfb (which is an X11 server) a solution the problem
> of requiring an X11 server?

I've used it before to run unit tests from batch under Solaris where no
interactive X display is attached for code targeted to run using WxWidgets
on Windows.
Unless you actually need a display to look at it's useful to be able to run
libraries that expect a display.

Regards, Peter
http://perl.dragonstaff.co.uk
___
List: Catalyst@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/


Re: [Catalyst] How to extend authentication to use other DB fields?

2010-03-25 Thread Julien Sobrier
Hello,
I am not really sure what you mean. I have tried this, but
authentication always fails:

$c->authenticate({ facebook_id => $uid, active => 1 })

I have triple checked that the parameters are correct, and the user
exists in the database.


On Wed, Mar 24, 2010 at 10:59 PM, Evan Carroll  wrote:
>> I would like to extend my autentication to accept other fields:
>> with $c->authenticate({ fileld1 => [..], field2 => [...], fieldd => [...] });
>
> ...
>
>> Do I have to create my own Catalyst::Authentication::Credential plugin?
>
> No, it already does that... per the docs:
>
>    The first, and most common, method is simple retrieval. As its
> name implies simple
>    retrieval allows you to simply to provide the column => value
> pairs that should be
>    used to locate the user in question. An example of this usage is below:
>
> --
> Evan Carroll
> System Lord of the Internets
>
> ___
> List: Catalyst@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/
>

___
List: Catalyst@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/


Re: [Catalyst] How to extend authentication to use other DB fields?

2010-03-25 Thread Julien Sobrier
Actually, I found the reason:  password_type   => 'self_check',

To fix my issue, I added a second real with password_type   => 'clear',



__PACKAGE__->config->{'Plugin::Authentication'} = {
default => {
class   => 'SimpleDB',
user_model  => 'DB::User',
password_type   => 'self_check',
},
free => {
class   => 'SimpleDB',
user_model  => 'DB::User',
password_type   => 'clear',
},
};


There might be a better way to do it.

Julien

On Thu, Mar 25, 2010 at 8:16 PM, Julien Sobrier  wrote:
> Hello,
> I am not really sure what you mean. I have tried this, but
> authentication always fails:
>
> $c->authenticate({ facebook_id => $uid, active => 1 })
>
> I have triple checked that the parameters are correct, and the user
> exists in the database.
>
>
> On Wed, Mar 24, 2010 at 10:59 PM, Evan Carroll  wrote:
>>> I would like to extend my autentication to accept other fields:
>>> with $c->authenticate({ fileld1 => [..], field2 => [...], fieldd => [...] 
>>> });
>>
>> ...
>>
>>> Do I have to create my own Catalyst::Authentication::Credential plugin?
>>
>> No, it already does that... per the docs:
>>
>>    The first, and most common, method is simple retrieval. As its
>> name implies simple
>>    retrieval allows you to simply to provide the column => value
>> pairs that should be
>>    used to locate the user in question. An example of this usage is below:
>>
>> --
>> Evan Carroll
>> System Lord of the Internets
>>
>> ___
>> List: Catalyst@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/
>>
>

___
List: Catalyst@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/