View Full Version : Spring-security-core and two login pages
volnei.munhoz
Jul 11th, 2012, 03:32 PM
Is there any way to have two login pages (in grails) that each one redirects to a specified default url?
admin/login -> redirect to /admin/dashboard
user/login -> redirect to /user/dashboard
Thanks!
Rob Winch
Jul 11th, 2012, 04:11 PM
This answer on Stack Overflow (http://stackoverflow.com/questions/8326587/determine-target-url-based-on-roles-in-spring-security-3-1/8327582) should help. It may not provide the exact answer you are looking for, but it should give you enough information to get what you need.
volnei.munhoz
Jul 11th, 2012, 06:39 PM
Thanks Rob, I've found a similar solution in Grails user list, but the real problem is that I need two different login pages, the layout and some rules are different from each one.
spgmx
Jul 12th, 2012, 02:29 AM
Since Spring 3.1 you can have multiple <http/> elements. Here you can define different form-login elements for different patterns.
volnei.munhoz
Jul 12th, 2012, 06:25 AM
Since Spring 3.1 you can have multiple <http/> elements. Here you can define different form-login elements for different patterns.
Hi spgmx, thank you! I think that this is the solution, but I believe I'll need to wait until it is implemented by spring-security-core grails plugin.
=/
Rob Winch
Jul 12th, 2012, 09:08 AM
You can create an AuthenticationEntryPoint that will send the user to two different login pages based upon your given rules.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.