I want to create login page using authentication token.ApplicationOAuthProvider alread have functionality for login.but i dont know how to call the function in controller
This is i try
[HttpPost]
//[ValidateAntiForgeryToken]
public ActionResult Login(Login model)
{
HttpClient hc = new HttpClient();
hc.BaseAddress = new Uri("https://localhost:44357/Token");
var insertdata = hc.PostAsJsonAsync("Token", model);
insertdata.Wait();
var savedata = insertdata.Result;
if (savedata.IsSuccessStatusCode)
{
ViewBag.message = "The user" + model.UserName + "Is Saved Successfully ... !";
return View("Home");
}
return View();
}
//[ValidateAntiForgeryToken]
public ActionResult Login(Login model)
{
HttpClient hc = new HttpClient();
hc.BaseAddress = new Uri("https://localhost:44357/Token");
var insertdata = hc.PostAsJsonAsync
insertdata.Wait();
var savedata = insertdata.Result;
if (savedata.IsSuccessStatusCode)
{
ViewBag.message = "The user" + model.UserName + "Is Saved Successfully ... !";
return View("Home");
}
return View();
}
selvi jpPosted Apr 26, 2021, 4:20 AM
Salman BegPosted Apr 23, 2021, 1:08 PM