Save credentials to database. implemented password based security.