none
Azure active directory.

    Question

  • Hi, we have an ASP.NET MVC web application where we azure b2c authentication. There are several controllers and views in mvc application. Whenever user wants to access to controller we have checking whether he is signed in or not? On the basis of that if user is already signed then only we are giving access to him. On every controller's .cs file we have put code like :

      if (Request.IsAuthenticated)
          {
           some code;
            return View();
          }
          else
          {
            return RedirectToAction("Login", "Home");
          }

    This type of code on each action method of controller. Its working fine but most of the times it automatically kicked user out of the system frequently on login page to re-sign again.

    Ca anyone tell me how can I centarlized this type of code in mvc application for each controller so that it should not kicked me out of the system. Please help. Thanks.

    Wednesday, May 3, 2017 5:40 AM

Answers

All replies