If you don't already have a User entity and a working login system, first start with How to Load Security Users .. See Using a Custom Query to Load the User..