Hi Carlos, thanks for answering. I read that docs before asking here,
indeed. [?]

I already solve my problem. What I did to work around this issue was to set
a default_target_path to
a route named /loginredirect

that route calls to a controller named similar loginRedirectAction()
There I create a simple if, ifelse, else, that according to user's role
he/she would
be redirected to his/her most appropiated module (I have 3 roles, anonymous
(set by the security context), client, and admin).

Thanks for taking a look to my question. [?]


El 28 de marzo de 2011 01:29, Carlos Sánchez <carloss...@gmail.com>escribió:

> From http://symfony.com/doc/2.0/book/security/authentication.html
>
> After a successful authentication, the user is redirected based on the
> following algorithm:
>
>    * if always_use_default_target_path is true (false by default),
> redirect the user to the default_target_path (/ by default);
>    * if the request contains a parameter named _target_path
> (configurable via target_path_parameter), redirect the user to this
> parameter value;
>    * if there is a target URL stored in the session (which is done
> automatically when a user is redirected to the login page), redirect
> the user to that URL;
>    * if use_referer is set to true (false is the default), redirect
> the user to the Referrer URL;
>    * Redirect the user to the default_target_path URL (/ by default
>
> Hope it helps.
>
> This article might also:
>
> http://www.dobervich.com/2011/03/21/symfony2-blog-application-tutorial-part-v-intro-to-security/
>
> On Mar 26, 10:34 pm, oscar balladares <liebegr...@gmail.com> wrote:
> > Hi everybody. [?]
> >
> > I want to redirect a user to an especific route after
> login/authentication
> > according to his roles.
> >
> > I'm aware that Symfony2 authenticates users through _securty_check route
> and
> > it does't
> > require you to write a securityCheckAction() controller; also, if you
> > request something like /admin
> > and you are not authenticated, it will prompt the login page, and then
> > redirect to the requested url.
> >
> > But I want a custom redirect, because if I request /login route directly
> > Symfony2 will redirect me
> > to the same login page (now logged in).
> >
> > How can I accomplish this???
> > Is there a way to override the security_check action?
> > Do I have to use a listener? how?
> >
> > Thanks in advance [?]
> >
> >  349.gif
> > 1KViewDownload
> >
> >  330.gif
> > < 1KViewDownload
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

<<349.gif>>

<<360.gif>>

Reply via email to