Implementation of db auth

Implementation of db auth