54132

Question:
I need to append a suffix to the config value "grails.plugin.springsecurity.auth.loginFormUrl = /login/auth" dynamically at runtime. So I think I would have to change the field "loginFormUrl" in class "LoginUrlAuthenticationEntryPoint". The method "setLoginFormUrl" is deprecated so I wonder how can I change that at runtime? Should I inject/create a new "LoginUrlAuthenticationEntryPoint" everytime I need to do that? How/where would I do that?
Answer1:So the solution is quite simple. I implemented my own AuthenticationEntryPoint which is pretty much like the LoginUrlAuthenticationEntryPoint but has a different implementation of the determineUrlToUseForThisRequest method.
Then you only have to add this to your resources.groovy:
authenticationEntryPoint(MyCustomEntryPoint) {}