0

I develop Intranet application and i have a problem with AD role. User is logged by windows

<authentication mode="Windows"></authentication>

I need only read AD Roles of user by AspNetWindowsTokenRoleProvider provider

<roleManager defaultProvider="AspNetWindowsTokenRoleProvider" 
                 enabled="true" 
                 cacheRolesInCookie="false">
    <providers>
      <remove name="AspNetSqlRoleProvider" />
    </providers>
  </roleManager>

For reading role i used static class Roles (Roles.GetRolesForUser and Roles.IsUserInRole(roleName))...

When you extract a list of roles is alright:

foreach (var i in Roles.GetRolesForUser())
{
   tmp.Text += i + "<br />";
}

tmp is a ID of asp:Literal control.

For testing purposes, I created a test role in AD named TESTGROUP. I'll add a user to a role TESTGROUP, but this change is not reflected in the list of roles.

I saw a new role in the list does not help restart IIS, I have to restart the entire server.

I use Windows Server 2008 R2 and IIS 7. I adding a user to a group manually...

Does anyone know what the problem might be or what I have set wrong?

Thanks

Davecz
  • 1,199
  • 3
  • 19
  • 43
  • 1
    As far as I remember from back in 2008, each time you update the active directory groups, you have to re-authenticate that user. Which means logout and log back in. – Azhar Khorasany Aug 06 '13 at 09:03
  • Really? I did not know. This is my first application with AD. Thank you – Davecz Aug 06 '13 at 09:08

0 Answers0