added login function with spring-security