Using OWIN and Active Directory to authenticate users in ASP.Net MVC 5 application RRS feed

  • Question

  • User657329123 posted

    Hi there,

    I'm new to MVC and studying this code. Can someone help me understand this code http://tech.trailmax.info/2016/03/using-owin-and-active-directory-to-authenticate-users-in-asp-net-mvc-5-application/. Here are my questions:

    • How do I display the username of the currently logged in user in the username textbox on the login page?
    • Also i don't see an LDAP connection string anywhere in the code, so how does the username and password is validated?

    I add the following code but do not see the username in the textbox. Not getting any errors.

            public virtual ActionResult Index()
                ViewBag.Username = System.Web.HttpContext.Current.User;
                return View();


    Monday, August 29, 2016 3:16 PM

All replies