TRUNK-13: Move business logic for authentication into service layer

TRUNK-13: Move business logic for authentication into service layer

 Author:    Neelima Karipineni <n.karipineni@gmail.com>