I am trying to implement a functionality so that user after a successful Login should get redirected to same location from where he/she click the Login button.
I am using Spring MVC and for Login in some cases platform is using Spring security and for some third party Login process we are using out own mechanism.
I am wondering, is there any feature either in Spring MVC or Spring Security so that we can redirect user to same location from where he/she came.
Spring Security has provision to redirect the target URL
Have a look SavedRequestAwareAuthenticationSuccessHandler
There are four scenarios based on which ss decides on the redirect destination.