Saturday, March 31, 2012

Strange Authentication Issue

I'm trying to get the User.Identity.Name with my intranet application. I'm looking to get the Domain\User. Now, at first this simply did not work...User.Identity.Name would return nada. So then I poked around IIS a bit and I managed to switch the authentication methods. I checked off "Anonymous Access" and checked "Integrated Windows Authentication". After doing so, I was able to retrieve the Domain\user.

Great, dandy, fanny-tastic. Now comes the strange part. Certain users have access to re-open issues, so the powers that be created a new group on the server just for these users. When one of the users that belongs to this group accesses the site, they are prompted for a username and password from windows. Just those users in the group.

I don't have any code on page load that checks what role they're in, so what could I be missing here? I would like to get rid of the logon.

Thanks.

I was having the same problem and I fixed it. First of all I hope thereis some admin folder or the folder which special users are trying tovisit. That folder can have confidential files that are only viewableby special users. Go to IIS and view your project folder. right clickon the Admin folder and select properties and than select directorysecurity tab and uncheck windows authentication and check the Anonymousauthentication . Refresh your page and It should work fine now.


azamsharp wrote:

I was having the same problem and I fixed it. First of all I hope there is some admin folder or the folder which special users are trying to visit. That folder can have confidential files that are only viewable by special users. Go to IIS and view your project folder. right click on the Admin folder and select properties and than select directory security tab and uncheck windows authentication and check the Anonymous authentication . Refresh your page and It should work fine now.

The thing is, I had it set up for Anonymous at first. When it was set up that way, I couldn't retreive the Domain\User with User.Identity.Name. It would return nothing.


Yeah you are right. Strange thing is when I try to view restrictedpages using my University Wireless network I dont see the pop upmessage for the username and password. But when I use my dial upaccount at home I see the pop up.

azamsharp wrote:

Yeah you are right. Strange thing is when I try to view restricted pages using my University Wireless network I dont see the pop up message for the username and password. But when I use my dial up account at home I see the pop up.

Interesting. Sounds like your issue is similar to mine. I figured it out. (Well, my manager really did)

We were navigating to the site using the the full url of the domain, instead of the shorter version. Something like:

http://domain.blah.com/dir

When all we had to do was:

http://domain.blah/dir

So I guess using the .com appeared as if we were outside of the network, and therefore it promted for a username/password.

Thanks for your help and interest in my matter!


Thanks for sharing the solution.

0 comments:

Post a Comment