I am developing a grails application where I need to fiddle with the Session variables to implement Custom Spring Security authentication and need to set the following-
request.session[SPRING_SECURITY_LAST_USERNAME_KEY] =
TextEscapeUtils.escapeEntities(username)
Now this key comes from org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_USERNAME_KEY
which is now deprecated. Can you please suggest me an alternative for this?
Yes I have faced the same problem. And it has a very simple alternative-
import grails.plugin.springsecurity.SpringSecurityUtils;
Now use SpringSecurityUtils.SPRING_SECURITY_LAST_USERNAME_KEY this will work and is not deprecated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With