I am using Spring Security for Authentication. Currently i am authenticating username and password. Now my requirement is to add one more field with user name and password say something like Dept. Now if all the three values matches then only the user should be authenticated. Otherwise not. So how to add third field to my login page which will be authenticated along with user name and password. I came to know that userDetailsService will accept only username and password. how to add the third.