Quantcast

Spring Security: Redirect After Login?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Spring Security: Redirect After Login?

Daniel Glauser
Hello chaps,

We're at the point where we'd like to direct users with various roles to their own dashboards.  My esteemed colleague insists that the proper way to do this is with some sort of Spring Security piece, whereas I would like to put the logic in the auth() method of the login controller.  What is considered best practice?  It seems like right now the LoginController is handling much of the routing so the logic seems appropriate there.  

Thoughts?

Cheers,
Daniel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Spring Security: Redirect After Login?

olivertynes
http://burtbeckwith.github.com/grails-spring-security-core/docs/manual/guide/13%20URL%20Properties.html

Look at the 'always use default', put an action in the redirect
property that has the role based redirect rules and you're done.
If you don't use the always default stuff, the saved request (where
you tried to go when prompted for login) will be the destination the
client is sent to.

Alternatively you can use events, but that's more complicated and
weren't made with this kind of logic in mind, I would guess.

-Oliver

On Sat, Nov 19, 2011 at 11:46 PM, Daniel Glauser <[hidden email]> wrote:

> Hello chaps,
>
> We're at the point where we'd like to direct users with various roles to
> their own dashboards.  My esteemed colleague insists that the proper way to
> do this is with some sort of Spring Security piece, whereas I would like to
> put the logic in the auth() method of the login controller.  What is
> considered best practice?  It seems like right now the LoginController is
> handling much of the routing so the logic seems appropriate there.
>
> Thoughts?
>
> Cheers,
> Daniel
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Spring-Security-Redirect-After-Login-tp4087382p4087382.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
*****
Oliver Tynes
Developer
Uni CIPR -- www.cipr.uni.no
55588266
*****

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...