store credentials in db