ASP.NET - Basic/SSL - Changes in user group membership delayed

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default ASP.NET - Basic/SSL - Changes in user group membership delayed

    Background: An ASP.NET application, using Basic/SSL authentication with users
    residing in an Active Directory in the same domain as the web server, pages
    and resources protected with NTFS ACL's and ASP.NET configured for
    impersonation works fine.

    Observation: But, it appears that the ASP.NET worker process, once it has
    impersonated a user, will re-use that same user token when when the same user
    is re-authenticated after having started a new browser.

    The problem, as it appears: A user is given changed permissions by an
    administrator by changing group memberships in Active Directory. This change
    has no effect in the ASP.NET application until IIS is restarted (or possibly
    ASP.NET worker process dies out of boredom by itself).

    The question: How to make user group memberships changes effective, at least
    after the user has restarted a browser?

    Svante
    Svante Guest

  2. Similar Questions and Discussions

    1. NEW USER - BASIC QUESTION
      Hi everyone. I have no idea how Contribute works but am looking at purchasing it as what seems to be a client side update solution. I have...
    2. Getting Group Membership
      Hi, I'm trying to do something that I think should be pretty easy, take the user who is authenticated with the application (intranet application/...
    3. Checking group membership
      In ASP.Net I'm trying to check for some users membership of a group. The user is not nessicerily the user requesting the page, and I do not have...
    4. LDAP group membership query
      I am trying to query an NDS tree using the Win32::OLE and Win32::OLE::Enum modules. I was able to traverse the tree and gather all the group...
    5. Membership of group
      Hi All, I know that exist "innetgr" function in C, to test the membership of an user to a netgroup. I would like to know if a similar...
  3. #2

    Default Re: ASP.NET - Basic/SSL - Changes in user group membership delayed

    On Wed, 8 Dec 2004 01:53:02 -0800, Svante <Svante@discussions.microsoft.com> wrote:

    ¤ Background: An ASP.NET application, using Basic/SSL authentication with users
    ¤ residing in an Active Directory in the same domain as the web server, pages
    ¤ and resources protected with NTFS ACL's and ASP.NET configured for
    ¤ impersonation works fine.
    ¤
    ¤ Observation: But, it appears that the ASP.NET worker process, once it has
    ¤ impersonated a user, will re-use that same user token when when the same user
    ¤ is re-authenticated after having started a new browser.
    ¤
    ¤ The problem, as it appears: A user is given changed permissions by an
    ¤ administrator by changing group memberships in Active Directory. This change
    ¤ has no effect in the ASP.NET application until IIS is restarted (or possibly
    ¤ ASP.NET worker process dies out of boredom by itself).
    ¤
    ¤ The question: How to make user group memberships changes effective, at least
    ¤ after the user has restarted a browser?

    Is there any chance your network configuration implements load balancing domain controllers, or are
    you using a single domain controller.?

    Based upon my understanding of authenticated credentials and the checking of permissions with
    respect to resources and IIS, I don't think the description in your observation is possible.


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

  4. #3

    Default Re: ASP.NET - Basic/SSL - Changes in user group membership delayed

    "Paul Clement" wrote:

    (snip)
    > ¤ Observation: But, it appears that the ASP.NET worker process, once it has
    > ¤ impersonated a user, will re-use that same user token when when the same user
    > ¤ is re-authenticated after having started a new browser.
    (snip)
    > Is there any chance your network configuration implements load balancing domain controllers, or are
    > you using a single domain controller.?
    Single in this case. Production is load balancing, and there's a known
    propagation delay between them in that case. That's not the problem here.
    > Based upon my understanding of authenticated credentials and the checking of permissions with
    > respect to resources and IIS, I don't think the description in your observation is possible.
    >
    The suggested model for explanation may well be wrong, but the basic
    observation is certainly possible....

    0 - I log on via Basic Authentication/SSL after browsing to my app. The app
    impersonates the authenticated user, and access a file wherafter I close the
    browser.
    1 - I remove the user from a group in Active Directory.
    2- I log on via Basic Authentication/SSL after browsing to my app. The app
    impersonates the authenticated users.
    3 - The app can access files that provably require membership in the just
    removed-from group, until I restart IIS (or probably restart ASP.NET worker
    process, I can't definitely say though since it takes too long time to wait,
    and I can't seem to just kill it manually).

    Svante
    Svante Guest

  5. #4

    Default Re: ASP.NET - Basic/SSL - Changes in user group membership delayed

    On Wed, 8 Dec 2004 07:13:05 -0800, Svante <Svante@discussions.microsoft.com> wrote:

    ¤ "Paul Clement" wrote:
    ¤
    ¤ (snip)
    ¤ > ¤ Observation: But, it appears that the ASP.NET worker process, once it has
    ¤ > ¤ impersonated a user, will re-use that same user token when when the same user
    ¤ > ¤ is re-authenticated after having started a new browser.
    ¤ (snip)
    ¤ > Is there any chance your network configuration implements load balancing domain controllers, or are
    ¤ > you using a single domain controller.?
    ¤ Single in this case. Production is load balancing, and there's a known
    ¤ propagation delay between them in that case. That's not the problem here.
    ¤
    ¤ > Based upon my understanding of authenticated credentials and the checking of permissions with
    ¤ > respect to resources and IIS, I don't think the description in your observation is possible.
    ¤ >
    ¤
    ¤ The suggested model for explanation may well be wrong, but the basic
    ¤ observation is certainly possible....
    ¤
    ¤ 0 - I log on via Basic Authentication/SSL after browsing to my app. The app
    ¤ impersonates the authenticated user, and access a file wherafter I close the
    ¤ browser.
    ¤ 1 - I remove the user from a group in Active Directory.
    ¤ 2- I log on via Basic Authentication/SSL after browsing to my app. The app
    ¤ impersonates the authenticated users.
    ¤ 3 - The app can access files that provably require membership in the just
    ¤ removed-from group, until I restart IIS (or probably restart ASP.NET worker
    ¤ process, I can't definitely say though since it takes too long time to wait,
    ¤ and I can't seem to just kill it manually).
    ¤
    ¤ Svante

    What is the Application Protection for this application? Low (IIS), Medium (Pooled) or High
    (Isolated)?


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

  6. #5

    Default Re: ASP.NET - Basic/SSL - Changes in user group membership delayed

    (snip)
    > What is the Application Protection for this application? Low (IIS), Medium (Pooled) or High
    > (Isolated)?
    (snip)
    Medium. I thought you said that it could not possibly have to do with
    thread/token re-use by the ASP.NET worker process... ;-)

    I have not tried changing this setting, nor do I want to - I want to know
    what is happening and how I can handle it regardless of this or any other
    similar settings which as more far ranging effects.

    Svante
    Svante Guest

  7. #6

    Default Re: ASP.NET - Basic/SSL - Changes in user group membership delayed

    On Thu, 9 Dec 2004 09:27:02 -0800, Svante <Svante@discussions.microsoft.com> wrote:

    ¤ (snip)
    ¤ > What is the Application Protection for this application? Low (IIS), Medium (Pooled) or High
    ¤ > (Isolated)?
    ¤ (snip)
    ¤ Medium. I thought you said that it could not possibly have to do with
    ¤ thread/token re-use by the ASP.NET worker process... ;-)
    ¤

    I don't believe that it does, but lacking another explanation as to why declarative security isn't
    working as expected, it certainly doesn't hurt to consider that the web server, for some reason
    unknown to me, is caching credentials.

    Have you verified that impersonation is working properly. I'm assuming that you're impersonating the
    user authenticated via the browser and not an account specified in the web.config file?


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

  8. #7

    Default Re: ASP.NET - Basic/SSL - Changes in user group membership delayed

    I actually wouldn't be surprised if the token on the server was getting
    reused and that would be a good explanation for the problem. If the
    kerberos ticket is cached on the server, it might not get refreshed right
    away. I'm pretty sure the server isn't going to make a round trip to the
    KDC for every single authentication. This is probably a better question for
    the Windows server guys though to get the details of how the LSA is handling
    this.

    Joe K.

    "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
    news:st2hr096dn2thquh0cnnspl7u3phc4ilqb@4ax.com...
    > On Thu, 9 Dec 2004 09:27:02 -0800, Svante
    > <Svante@discussions.microsoft.com> wrote:
    >
    > ¤ (snip)
    > ¤ > What is the Application Protection for this application? Low (IIS),
    > Medium (Pooled) or High
    > ¤ > (Isolated)?
    > ¤ (snip)
    > ¤ Medium. I thought you said that it could not possibly have to do with
    > ¤ thread/token re-use by the ASP.NET worker process... ;-)
    > ¤
    >
    > I don't believe that it does, but lacking another explanation as to why
    > declarative security isn't
    > working as expected, it certainly doesn't hurt to consider that the web
    > server, for some reason
    > unknown to me, is caching credentials.
    >
    > Have you verified that impersonation is working properly. I'm assuming
    > that you're impersonating the
    > user authenticated via the browser and not an account specified in the
    > web.config file?
    >
    >
    > Paul ~~~ [email]pclement@ameritech.net[/email]
    > Microsoft MVP (Visual Basic)

    Joe Kaplan \(MVP - ADSI\) Guest

  9. #8

    Default Re: ASP.NET - Basic/SSL - Changes in user group membership delayed

    (snip)
    > Have you verified that impersonation is working properly. I'm assuming that you're impersonating the
    > user authenticated via the browser and not an account specified in the web.config file?
    (snip)
    Yes and yes and no.

    Svante
    Svante Guest

  10. #9

    Default Re: ASP.NET - Basic/SSL - Changes in user group membership delayed

    "Joe Kaplan (MVP - ADSI)" wrote:
    > I actually wouldn't be surprised if the token on the server was getting
    > reused and that would be a good explanation for the problem. If the
    > kerberos ticket is cached on the server, it might not get refreshed right
    > away. I'm pretty sure the server isn't going to make a round trip to the
    > KDC for every single authentication. This is probably a better question for
    > the Windows server guys though to get the details of how the LSA is handling
    > this.
    (snip)

    Thank you for your support :-) The only problem I have with your suggestion
    of going to the server guys is that it appears to be strictly related to IIS
    (ASP.NET Worker Process?). If I restart IIS the changes are effective
    immediately.

    How would that affect the server's basic caching of credentials?

    Svante

    Svante Guest

  11. #10

    Default Re: ASP.NET - Basic/SSL - Changes in user group membership delayed

    It could be that IIS is caching token handles in its own process memory and
    reusing those or might be that killing IIS causes the token to get removed
    from the box.

    I'd still ask the server guys, but this question might need to go to the
    guys who do IIS specifically. Like I said, I was just guessing. It
    definitely appears that somewhere in the chain, a slightly outdated version
    of the user's token is being used, so it must be getting cached somewhere.
    We just don't know the details.

    If you find the real answer, please let us know.

    Joe K.

    "Svante" <Svante@discussions.microsoft.com> wrote in message
    news:154BABF8-2D9C-4B4A-87CC-1E13266AAC58@microsoft.com...
    > "Joe Kaplan (MVP - ADSI)" wrote:
    >
    >> I actually wouldn't be surprised if the token on the server was getting
    >> reused and that would be a good explanation for the problem. If the
    >> kerberos ticket is cached on the server, it might not get refreshed right
    >> away. I'm pretty sure the server isn't going to make a round trip to the
    >> KDC for every single authentication. This is probably a better question
    >> for
    >> the Windows server guys though to get the details of how the LSA is
    >> handling
    >> this.
    > (snip)
    >
    > Thank you for your support :-) The only problem I have with your
    > suggestion
    > of going to the server guys is that it appears to be strictly related to
    > IIS
    > (ASP.NET Worker Process?). If I restart IIS the changes are effective
    > immediately.
    >
    > How would that affect the server's basic caching of credentials?
    >
    > Svante
    >

    Joe Kaplan \(MVP - ADSI\) Guest

  12. #11

    Default Re: ASP.NET - Basic/SSL - Changes in user group membership delayed

    On Thu, 9 Dec 2004 11:19:05 -0800, Svante <Svante@discussions.microsoft.com> wrote:

    ¤ (snip)
    ¤ > Have you verified that impersonation is working properly. I'm assuming that you're impersonating the
    ¤ > user authenticated via the browser and not an account specified in the web.config file?
    ¤ (snip)
    ¤ Yes and yes and no.

    Have you tried checking the group membership programmatically via ADSI or DirectoryServices (from
    the web app) to ensure that the change is being reflected? This would eliminate AD as the culprit if
    the change is reflected (user no longer in group).


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

  13. #12

    Default Re: ASP.NET - Basic/SSL - Changes in user group membership delayed

    I am seeing the exact same symptoms. Did you ever find a solution?
    kometes is offline Junior Member
    Join Date
    Oct 2011
    Posts
    1

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139