Last post Dec 10, 2018 01:52 PM by mgebhard
Dec 04, 2018 03:03 AM|VinitaJain|LINK
Dec 05, 2018 03:12 AM|Ackerly Xu|LINK
What authentication are you using in application?FormsAuthentication or WindowsAuthentication?
Have your application thrown any error?
You say the code suddenly stopped and throw null value.
Do you mean HttpContext.Current.User is null?
If it is the case , you could refer to the link below
Please post your web.config and your related code.
Dec 09, 2018 05:08 PM|VinitaJain|LINK
Dec 09, 2018 05:25 PM|mgebhard|LINK
I'm using Windows authentication in my web application & below piece of code is used to fetch the ID of currently logged in user.
String ID = HttpContext.Current.User.Identity.ToString();
The behavior usually indicates Forms Authentication is enabled. Check your IIS configuration.
It can also be due to a logical error where the Identity is checked outside of an HTTP request.
Dec 10, 2018 03:44 AM|VinitaJain|LINK
Dec 10, 2018 12:52 PM|mgebhard|LINK
This code works when application is hosted in IIS but I'm facing issue in local host & also, same piece of code was working fine few days back. Not sure why this issue suddenly. I didn't make any changes in the logic.
Again, this behavior indicates an IIS (localhost) configuration issue. Please check your configuration.
Dec 10, 2018 01:31 PM|VinitaJain|LINK
Dec 10, 2018 01:52 PM|mgebhard|LINK
It would be helpful if you can guide me to correct those configurations.
If the application is hosted in IIS then see IIS support documentation.
If the application is hosted in IIS Express then see the docs for IIS Express.
If this is an ASP.Core app then see the docs for Core.