开发者

ASP.NET role based security with AzMan and AD roles

开发者 https://www.devze.com 2023-01-27 15:49 出处:网络
I\'m trying to evaluate AzMan for one of my ASP.NET applications but I have a strange problem. My test application expects three roles:

I'm trying to evaluate AzMan for one of my ASP.NET applications but I have a strange problem. My test application expects three roles:

  • User
  • Owner
  • Admin

I created XML Authorization store located in application's App_Data and added these role definitions. I configured my test ASP.NET application to use AuthorizationStoreRoleProvider and I added some test code wich uses Principal.IsInRole and PrincipalPermission. Everything worked well on my local computer with local accounts assigned to roles in AzMan.

Then I moved my test application to the server and a I assigned Active Directory users and Groups to AzMan's roles. Now PrincipalPermission and Principal.IsInRole don't work any more. Interesting is that if I assign builtin Everyone group into any role it works so there is some problem with AD users and groups assigned to roles. Can I use XML authorizatio开发者_如何学Gon store with AD groups and users? What else can cause such problems?


Check the security settings on your asp.net application.

It sounds like annonymous authentication is on, so your users are coming in as annonymous users, not themselves, therefore it works for the everyone group.


    <roleManager enabled="true" cacheRolesInCookie="false" cookieName=".ASPXROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All" defaultProvider="AspNetWindowsTokenRoleProvider" createPersistentCookie="false" maxCachedResults="25">
        <providers>
            <clear/>
            <add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
        </providers>
    </roleManager>
0

精彩评论

暂无评论...
验证码 换一张
取 消