I would like to verify that the following authentication problem can be solved using Spring Security - Pre authentication scenario:
Problem:
- A user logs in via a legacy system
- Calls pages to a web system (created in spring mvc)
- When calling the pages to the web system it (the legacy system) passes a token, username and user_role
- The web system then uses web services provided by the legacy system to verify the username and the token.
- If valid a session is created on the web system and user is able to use the web page else the user is directed to an error page
Can I make use of the pre-authentication scenario that spring security offers? OR is it easier to just create a Spring AOP aspect that will verify the validity of the token and the user?
The spring security documentation is not very good in explaining the correct use of pre-authentication scenario. Please guide me to take the best possible route. If more information is required let me know.
Good examples or links welcome.