Refactored the way REST services get username/password for authentication.