public bool Authenticate(string username, string password) { ResponseAPIModel <UserModel> user = null; password = CommonMethods.Base64Encode(password); user = db.SignIn(username, password); if (!user.IsRequestSuccesful) { throw new UserCredentialsException(user.ValidationError); } SerializeUser(user.Content); return(true); }