Moved user credential and authentication code to Common.