public HttpResponseMessage GetUserAuthentication(string userName, string password)
        {
            AuthenticateResponse authenticate = _authenticate.GetUserDetailsByCredientials(userName, password);
            UserIdentity         userIdentity = null;

            if (authenticate != null)
            {
                var token    = Token.Instance.Generate(userName);
                var response = Request.CreateResponse(HttpStatusCode.OK, userIdentity = new UserIdentity
                {
                    UserName = authenticate.UserName,
                    RoleName = authenticate.RoleName
                });

                // var response = Request.CreateResponse(HttpStatusCode.OK, objResponse);
                response.Headers.Add("Token", token.TokenId.ToString());

                return(response);
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.Unauthorized, Constants.Unauthorized));
            }
        }
 public AuthenticateResponse GetUserAuthentication(string userName, string password)
 {
     logger.Info(string.Format("ActionName:GetUserAuthentication, UserName:{0}, Password:{1}", userName, password));
     return(_authenticate.GetUserDetailsByCredientials(userName, password));
 }