Click here to Skip to main content
15,868,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Is there any scenario where Context.User.Identity.Name is a null or empty string while in production environment ?

I have an application which uses an windows authentication and LDAP to authenticate users for my application.

The issue I am facing is in production for some reason the AuthenticateUser Method which take a string parameter of userId i.e. Context.User.Identity.Name is returning empty string.
the above scenario is only occurring sometimes in Production.

Now my question is " Is it possible that the Context.User.Identity.Name = string.Empty?"
Posted

 
Share this answer
 
Comments
rajeshkasani05 28-Oct-14 4:11am    
@Mathew thanks for your solution. It has helped a lot. I need to figure out why is the Identity.Name is empty only in some scenarios. Thanks once again Mathew.
Try to check it as follows;

C#
if (partner != null && partner.Length > 0)
               {}



sibinkt[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900