Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Why is the authorization context with multiple PSGI applications in Catalyst not working?

13 views
Skip to first unread message

abir brahem

unread,
Jan 29, 2014, 6:35:58 AM1/29/14
to psgi-...@googlegroups.com

I have tow cascading Plack middleware applications(app1app2), app1 is the front application. I followed these tutorials:

This is my code:

use Plack::App::Cascade;
use Plack::App::URLMap;
use lib "/var/www/app1/lib",
    "/var/www/app2/lib";
use app1;
use app2;

my $app1 = app1->psgi_app(@_);
my $app2 = app2->psgi_app(@_);

my $app_map1 = Plack::App::URLMap->new;
$app_map2->mount( '/' => $app1 );

my $app2 = Plack::App::URLMap->new;
$app2->mount( '/app2' => $app2 );

Plack::App::Cascade->new(apps => [ $app_map1, $app_map2 ])->to_app;

Until now everything is ok, I added also the authentication functionality, and for that i used these two catalyst modules: Catalyst::Plugin::Authentication and Catalyst::Plugin::Authorization::Abilities.

The authentication part is working fine for the two applications (user logged from app1), but I got a problem for the authorization part just for app2. When I try to figure out, it was the context variable $c. The app1$c variable was not the same as app2. After authentication (from app1) I got a user object $c->user, but for the second application I had a new $c created and the $c->user is not found.

So how can these two applications get the same context $c?

Reply all
Reply to author
Forward
Message has been deleted
0 new messages