Results 1 to 6 of 6

Thread: Trouble with authentication in asp.net

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Trouble with authentication in asp.net

    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?
    /Henrik

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Trouble with authentication in asp.net

    Have you set identity impersonation to true?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Re: Trouble with authentication in asp.net

    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

  4. #4
    Member
    Join Date
    Nov 2004
    Location
    KS, USA
    Posts
    34

    Re: Trouble with authentication in asp.net

    Maybe you need to disable "anonymous" in the IIS server.
    It may be passing "anonymous" instead of the user id.
    ?

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Re: Trouble with authentication in asp.net

    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

  6. #6
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: Trouble with authentication in asp.net

    Have you restarted the machine for the group changes to take effect? Or tried issuing iisreset at the command prompt?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width