Added code to integration with Spring security.