1

In a current Grails app I'm working on all my account management now happens under an account controller which I would like to keep all those actions mapped under the /account/* URL pattern.

I'm using Spring Security Core. On a failed login the app still directs me to
/login/authfail?login_error=1
I want it to use
/account/authfail?login_error=1

So my question is how do I configure the default
SpringSecurityUtils.securityConfig.successHandler.defaultTargetUrl
and whatever the failure URL is also (I need to know the name of this property) Is this documented somewhere?

BuddyJoe
  • 69,735
  • 114
  • 291
  • 466

2 Answers2

3

The spring-security-core plugin is actually one of the best documented plugins out there. You can find all the URL configuration options here. Specifically, you want failureHandler.defaultFailureUrl and possibly failureHandler.ajaxAuthFailUrl. Note that I believe these will be global changes. So if you need to lock down other aspets of your site other than "accounts" the URL for a failed attempt will be the same as you configured it.

Gregg
  • 34,973
  • 19
  • 109
  • 214
  • I was able to find it using site:burtbeckwith.github.com and then the search terms on google. thanks +1 Here is the list of props http://burtbeckwith.github.com/grails-spring-security-core/docs/manual/guide/13%20URL%20Properties.html I'll try this and then come back and mark the question – BuddyJoe May 30 '11 at 22:28
  • This line in Config.groovy worked - grails.plugins.springsecurity.failureHandler.defaultFailureUrl = '/account/authfail?login_error=1' – BuddyJoe May 30 '11 at 22:34
0

In UrlMapping.groovy, add an instruction like :

"/account/$action?/$id?"{
   controller="login"
}
Jonathan Lebrun
  • 1,462
  • 3
  • 20
  • 42