I am using the following code to retrieve the username:
Request.ServerVariables("REMOTE_USER")
For some reason it only works with some users? It seems to be the new users that were created recently that it is returning blank? The difference between the old users and new
users is that the new user account have 7 characters for a username where the old one is 5. Any ideas? Thanks!
Thanks for the responses, still does not work. Really confusing as to why it only is working for older users. I logged on as one of the new users using my browser and does not work, but if I do a 'run as" as an older account it works?
A.Venkatesan
Microsoft Certified Professional
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact venkatmca008@gmail.com
I changed it to
HttpContext.Current.User.Identity.Name.ToString() and now all users are returning blank. I have modified the web config and tried everything suggested. Maybe its something in active directory for the new users that
is preventing this. I checked the attributes and it matches the other accounts. Very puzzling...
A.Venkatesan
Microsoft Certified Professional
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact venkatmca008@gmail.com
Marked as answer by MKozlowski on Mar 08, 2012 06:51 PM
did u followed my post? even when u do "Run As" and use some other credentials.... the browser settings are changed (browser settings are baed on individual user profile)
it might be that, when doing Run as, and using some other user id, due to browser setting, blank username/password is being passed
hope this helps...
Cheers!
KK
Please mark as Answer if post helps in resolving your issue
My Site
Marked as answer by MKozlowski on Mar 08, 2012 06:51 PM
Ya, I verified the settings were set after when I was doing the run as. What I dont understand is why would it have a blank username and password for some accounts and not others. You would think that it either it does it for all or none.
MKozlowski
Member
500 Points
573 Posts
Request.ServerVariables("REMOTE_USER") strange issue help.
Mar 08, 2012 12:25 PM|LINK
Hi,
I am using the following code to retrieve the username:
Request.ServerVariables("REMOTE_USER")
For some reason it only works with some users? It seems to be the new users that were created recently that it is returning blank? The difference between the old users and new users is that the new user account have 7 characters for a username where the old one is 5. Any ideas? Thanks!
vijayano
Member
162 Points
51 Posts
Re: Request.ServerVariables("REMOTE_USER") strange issue help.
Mar 08, 2012 01:03 PM|LINK
Hello,
The below link might help you.
http://support.microsoft.com/kb/306359
kedarrkulkar...
All-Star
34535 Points
5554 Posts
Re: Request.ServerVariables("REMOTE_USER") strange issue help.
Mar 08, 2012 01:05 PM|LINK
check if this relates to u r problem
http://forums.asp.net/t/1639556.aspx/1
also, do this test on users machine...
for the users where it is not working, open Internete explorer
go to Tools->internet options.. in the securiyt tab, select appropriate zone at top and then click on "custom level" button...
the new dialogue will appear... in this dialogue, scroll till end and check Logon "section"
mark check option "Automatic logon with current username and password" and restart all browser windows...
now ask user to open the web page and see if REMOTE_USER value is received
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
MKozlowski
Member
500 Points
573 Posts
Re: Request.ServerVariables("REMOTE_USER") strange issue help.
Mar 08, 2012 01:24 PM|LINK
Thanks for the responses, still does not work. Really confusing as to why it only is working for older users. I logged on as one of the new users using my browser and does not work, but if I do a 'run as" as an older account it works?
venkatmca008
Participant
1810 Points
341 Posts
Re: Request.ServerVariables("REMOTE_USER") strange issue help.
Mar 08, 2012 01:28 PM|LINK
try this..
strName = HttpContext.Current.User.Identity.Name.ToString()
and please refer this...and let me know
http://www.codeproject.com/Articles/12614/How-to-Get-Window-NT-Logged-User-Name-Using-ASP-NE
http://forums.asp.net/t/1179997.aspx/1
Microsoft Certified Professional
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact venkatmca008@gmail.com
MKozlowski
Member
500 Points
573 Posts
Re: Request.ServerVariables("REMOTE_USER") strange issue help.
Mar 08, 2012 01:42 PM|LINK
I changed it to HttpContext.Current.User.Identity.Name.ToString() and now all users are returning blank. I have modified the web config and tried everything suggested. Maybe its something in active directory for the new users that is preventing this. I checked the attributes and it matches the other accounts. Very puzzling...
venkatmca008
Participant
1810 Points
341 Posts
Re: Request.ServerVariables("REMOTE_USER") strange issue help.
Mar 08, 2012 02:18 PM|LINK
hi..frd try this..
http://forums.asp.net/t/1639556.aspx/1
Microsoft Certified Professional
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact venkatmca008@gmail.com
MKozlowski
Member
500 Points
573 Posts
Re: Request.ServerVariables("REMOTE_USER") strange issue help.
Mar 08, 2012 02:27 PM|LINK
I did everything those links suggested but same issue. Not sure ?
kedarrkulkar...
All-Star
34535 Points
5554 Posts
Re: Request.ServerVariables("REMOTE_USER") strange issue help.
Mar 08, 2012 03:02 PM|LINK
did u followed my post? even when u do "Run As" and use some other credentials.... the browser settings are changed (browser settings are baed on individual user profile)
it might be that, when doing Run as, and using some other user id, due to browser setting, blank username/password is being passed
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
MKozlowski
Member
500 Points
573 Posts
Re: Request.ServerVariables("REMOTE_USER") strange issue help.
Mar 08, 2012 03:12 PM|LINK
Ya, I verified the settings were set after when I was doing the run as. What I dont understand is why would it have a blank username and password for some accounts and not others. You would think that it either it does it for all or none.