I need to do some processing only after the user has successfully logged in the system. I have thought that I can do a RESTful method and setting it as the default-target-url so when the login is successful it goes to this url and then I can redirect to the real index of my web application.
<form-login login-page='/login.htm' default-target-url='/home.htm' always-use-default-target='true' />
The problem is that this processing can be executed by calling its URL so it could be executed by any user at any time. I want to make sure it is only executed after login.
Is there any way to do this?
Thank you very much.
I solved it by creating a handler which extends SavedRequestAwareAuthenticationSuccessHandler implements AuthenticationSuccessHandler and by doing my custom implementation in onAuthenticationSuccess method.
To call this handler after the succeeded Login I set authentication-success-handler-ref property in the XML configuration.