locked
System.Web.HttpContext.Current.User.Identity.IsAuthenticated RRS feed

  • Question

  • User-931618397 posted

    we are using System.Web.HttpContext.Current.User.Identity.IsAuthenticated to authenticate the user to access few pages from our website. We hosted the website on Virtual machine. It is unable to authenticate even I provide the correct virtual machine credentials.It is working with other system which is not vitual machine. So, Can any body help me to sort out this issue?

    Monday, June 16, 2014 7:34 AM

Answers

  • User-931618397 posted

    Thanks again for the reply...

    This issue has been resolved by installing the Windows Authentication feature on IIS and enabling the windows Authentication on Authentication panel of website.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 23, 2014 12:26 AM

All replies

  • User753101303 posted

    Hi,

    we are using System.Web.HttpContext.Current.User.Identity.IsAuthenticated to authenticate the user

    Unclear. It tells if the user is authenticated or not. It doesn't authenticate the user as such. Also "I provide the correct virtual machine credentials" is not crystal clear. Which authentication method do you use for your site? Where do you provide those credentials? Which credentials do you provide? (the user should provide its own credential, I'm not sure what you called "virtual machine credentials").

    If you meant your app runs under a particular account which is defined on the VM, it is not enough to have IsAuthenticated being true. IsAuthenticated is true if you do know who is the user using the browser that access to the web site (either using Windows integrated authentication or a login form).

     

    Monday, June 16, 2014 7:46 AM
  • User-931618397 posted

    Hi PatriceSc,

    Thanks for reply.

      The website's wen.config configured authentication as <authentication mode="Windows"/>.  we have same website hosted on another machine(this is not virtual machine). when we are accessing that website IsAuthenticated is true If I provide the windows login credentials of that machine.
      As I said now the website is hosted on virtual machine. the website on virtual machine is unable through the "IsAuthenticated" if I give the virtual machine's windows authentication credentials.
      So, Am I missing something to configure for websites authentication when it is hosted on virtual machines?

    Thanks

    Shyambabu K

    Monday, June 16, 2014 8:32 AM
  • User753101303 posted

    VMs are part of the domain ? They do have access to a domain controller ? What happens exactly when you provide a user credential  (I'm still not sure what you call the "Windows login credentials of that machine"?). To me what should be provided is the credential for whatever user that wants to log to the site. This is not a machine but a user that logs to the site. The machine can run web pages under its own identity but is is unrelated to the authenticated user. Try the Windows log and in particular the Security log that might tell you what didn't worked when you try to log.

    BTW have you succeeded in giving access to the Windows groups that are allowed to access this app ? (if not it would likely show for now you just can't access the domain from this VM).

    We are using VMs but this is rather an admin side configuration and as a developper whatever they have done just works for us (basically I have almost no way to tell this is actually a VM and basically I never have to care wether or not this is VM, it just works the same). At some point you'll perhaps have better help in an IIS admin forum at http://forums.iis.net/ rather than in a development oriented forum.

    Edit : going back to this "virtual machine's windows authentication credentials". Is this the same credentials that the one which is used on the non VM machine that works? Once again if you just want a replacement there should be no difference that is if some user credentials allows to have access then the same user credential should be able to have access as well. It seems to me you might confuse the credentials under which the app runs and credentials used to know who is accessing the site through a browser.

    Monday, June 16, 2014 8:45 AM
  • User-931618397 posted

    Thanks again for the reply...

    This issue has been resolved by installing the Windows Authentication feature on IIS and enabling the windows Authentication on Authentication panel of website.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 23, 2014 12:26 AM