Last post Mar 08, 2012 02:50 PM by MKozlowski
Mar 08, 2012 08:25 AM|MKozlowski|LINK
I am using the following code to retrieve the username:
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!
Mar 08, 2012 09:03 AM|vijayano|LINK
The below link might help you.
Mar 08, 2012 09:05 AM|kedarrkulkarni|LINK
check if this relates to u r problem
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...
Mar 08, 2012 09:24 AM|MKozlowski|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?
Mar 08, 2012 09:28 AM|venkatmca008|LINK
strName = HttpContext.Current.User.Identity.Name.ToString()
and please refer this...and let me know
Mar 08, 2012 09:42 AM|MKozlowski|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...
Mar 08, 2012 10:18 AM|venkatmca008|LINK
hi..frd try this..
Mar 08, 2012 10:27 AM|MKozlowski|LINK
I did everything those links suggested but same issue. Not sure ?
Mar 08, 2012 11:02 AM|kedarrkulkarni|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
Mar 08, 2012 11:12 AM|MKozlowski|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.
Mar 08, 2012 02:50 PM|MKozlowski|LINK
Thanks for all of your help, I found out was wrong. I had to strip off some characters :)