public void get_access_token(HttpContext context) { String username = context.Request.Form["username"]; String password = context.Request.Form["password"]; OAuthController oauthController = new OAuthController(); OAuthViewModel oauth = new OAuthViewModel(); oauth.access_token = ""; User user = new AuthenticationController().actionCheckLoginData(username, password); System.Diagnostics.Debug.WriteLine("User:"******" ,type:" + user.user_type); if (user != null) { if ((user.user_type == 1) || (user.user_type == 2)) { oauth.access_token = oauthController.actionGetNewTokenByUsernameAndPassword(username, password); } } System.Diagnostics.Debug.WriteLine(JsonConvert.SerializeObject(oauth)); context.Response.Write(JsonConvert.SerializeObject(oauth)); }
}//rejectRequisition public void get_access_token(HttpContext context) { System.Diagnostics.Debug.WriteLine("########### inside get_access_token######"); String username = context.Request.Form["username"]; String password = context.Request.Form["password"]; OAuthController oauthController = new OAuthController(); OAuthViewModel oauth = new OAuthViewModel(); oauth.access_token = ""; User user = new AuthenticationController().actionCheckLoginData(username, password); if (user != null) { System.Diagnostics.Debug.WriteLine("###########User type:" + user.user_type); if ((user.user_type == 2) || (user.user_type == 3)) { oauth.access_token = oauthController.actionGetNewTokenByUsernameAndPassword(username, password); } } context.Response.Write(JsonConvert.SerializeObject(oauth)); }