Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7727315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:25:46+00:00 2026-06-01T05:25:46+00:00

I have a grails site (grails 2.0 with spring security 1.2.6) login that’s supposed

  • 0

I have a grails site (grails 2.0 with spring security 1.2.6) login that’s supposed to redirect depending on what parameters are passed in through the URL.

For example, if you went to '/' you would go to the standard 'login/auth' but if you went to '/?org=abccorp' you would be redirected to 'landing/index'. Once you log in successfully you’ll be taken to different parts of the site based on the params passed in through the url and security role.

So far I have been able to get everything working in a normal scenario where someone logs in successfully. My problem comes from if someone fails the login, spring security redirects to the default 'login/authfail' action with no way of finding the original url or parameters.

Supposedly there’s a way to get these things but everything I’ve found has either been deprecated, moved or is simply not there.

Is there a way to get what params were originally passed in? Can I save them off somewhere between calls or something like that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:25:47+00:00Added an answer on June 1, 2026 at 5:25 am

    The authenticationFailureHandler bean uses a org.springframework.security.web.RedirectStrategy instance to do the redirect when login fails. This is by default a org.springframework.security.web.DefaultRedirectStrategy instance and is registered as the redirectStrategy bean. So you could replace the redirectStrategy bean for the authenticationFailureHandler bean with your own. It doesn’t look like it’d be practical to replace the whole redirectStrategy bean since you don’t have access to the Authentication so you wouldn’t know whether it was a failure or success redirect.

    To avoid redefining the whole authenticationFailureHandler bean, I’d just change the bean in BootStrap.groovy. It’d be something like this (I haven’t tested this so it might be off a bit)

    import com.foo.bar.MyRedirectStrategy
    
    class BootStrap {
    
       def authenticationFailureHandler
    
       def init = { servletContext ->
          authenticationFailureHandler.redirectStrategy = new MyRedirectStrategy()
       }
    }
    

    where MyRedirectStrategy is a custom subclass of DefaultRedirectStrategy (in src/groovy or src/java) that uses the request url to determine the redirect url.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started using grails and installed the spring-security and spring-security-ui plugins. I
I have a Grails project with pom.xml that is treated as Maven project by
I have a Grails app that loads its data from xml files and delivers
I have one grails application.In that I have one model class named Book. From
I have a Grails command object that contains an emailAddresses field, e.g. public class
I have read the documentation for Grails and Webtest in this site: http://www.grails.org/plugin/webtest And
I have Message domain class that is used to send an email to site
I have an application that uses the grails multi-tenant-core plug-in to host multiple versions
I have a grails(2.0.3) application that has a jar dependency on another project which
I have a grails application that attempts to use OpenID4Java to authenticate with our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.