Im trying to setup windoes based security for my asp.net web app in server 2003. This is what I have done
* Created the user "testuser" on the local machine
* created the group "testgroup" on the local machine
* added testuser -> testgroup
* created an asp.net webapp in IIS and set it to windows authentication
* in explorer, I have added testgroup to read rights on the web app folder.
* Now I run the app, I enter the username and password and it let me in..
BUT when I write User.IsInRole("testgroup") I get "false"... why is that? I should get "true"...
so my problem is with the groups, everything else works fine!!!
whats the problem?
/HenrikHave you set identity impersonation to true?
Yes!! But im not sure it matters?
I have done something similar for a winforms app, but there I fetched the group info from the AD using system.directoryservices and then created genericprincipal and genericidentity... then it works to check Thread.User.IsInRole("wewwq"),,,
im not sure what to do with asp.net to get the same functionality...
/henrik
Maybe you need to disable "anonymous" in the IIS server.
It may be passing "anonymous" instead of the user id.
?
i have disabled anonymous login in the IIS, and set to windows authentication... and I get the correct username when using User.Identity.Name its the groups that dont work correct
/Henrik
Have you restarted the machine for the group changes to take effect? Or tried issuing iisreset at the command prompt?
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment