spring-security sample code

resolves #3252