Last post Jul 09, 2010 04:22 PM by smirnov
Jul 08, 2010 02:56 PM|ravulareddy|LINK
Problem No. 1
When i run my project locally, it calculates 1) DomainName 2) Username 3) Manager Name 4) Display Name of User
without any problem
Whereas when i publish my site to the server, it only calculates 1) DomainName 2) Username and it returns the Manager Name and Display name as Null.
What do you think might be the problem? really going mad on this.
Problem No. 2
When i run the project locally, as i said, it calculates everything without any problem. For some users (who are in other domains, but those users are in the same Active Directory) it doesn't calcuate the Manager Name and doesn't display the Full
These two problems are killing me.
Would be eagerly waiting for your responses asap
active Directory vb.net asp.net
Jul 09, 2010 07:13 AM|sujitm|LINK
Try running the application under the same credentials as you run them locally. Most probably it looks like an issue with permissions.
Jul 09, 2010 07:21 AM|smirnov|LINK
It sounds like locally it's running under your own account, and on sever under ASP.NET account. Read about
Jul 09, 2010 11:48 AM|ravulareddy|LINK
Thank you for those replies,
I was thinking as told by smirnov, whether its running locally with my username and ASP.NET user on the Server. That is the reason I have used "<identity impersonate="true" />" in web.config. But still it didn't help me.
Waiting for more suggestions. Thanks and you have a blessed day
Jul 09, 2010 03:45 PM|smirnov|LINK
Is anonymous access enabled in IIS (in the Security tab in the IIS management console)? If impersonation enabled in the web.config file, ASP.NET impersonates the token passed to it by IIS, which is either an authenticated user or the anonymous user account.
Is authentication mode set to Windows in the web.config file?
Check with User.Identity.Name what identity you really get on the server
You can impersonate user programmatically
// Obtain the authenticated user's Identity
WindowsIdentity winId = (WindowsIdentity)HttpContext.Current.User.Identity;
WindowsImpersonationContext ctx = null;
// Start impersonating
ctx = winId.Impersonate();
// Now impersonating
// Access resources using the identity of the authenticated user
// Prevent exceptions from propagating
// Revert impersonation
if (ctx != null)
// Back to running under the default ASP.NET process identity
Jul 09, 2010 04:18 PM|ravulareddy|LINK
hello smirnov,Thanks a lot for your reply and i really appreciate your help.
Now coming back, yeah authentication mode set to Windows in the web.config file and anonymous is unchecked.
How do i Check with User.Identity.Name what identity you really get on the server? How do i check the user's identity on the server? How can i do the debugging on the Server?
If you could answer this question, i would be more than happy
Jul 09, 2010 04:22 PM|smirnov|LINK
Well, I think that was explained in the article. Basically you should just add
into your page to see the current identity.