Re: Azman returns cached roles to .Net API



Hi,

aah - you have to set the cacheRefreshInterval attribute in the provider config. It is set to 60 (minutes i guess) by default.

MSDN says

"Gets the number of minutes between refreshes of the cache of the policy-store data."

:)

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Web.Config

1.Connection Strings.
<add name="ADConnectionString"
connectionString="LDAP://server.domain.local/CN=Users,DC=domain,DC=loc
al"/>
<add name="AzManConnectionString"
connectionString="msldap://server/CN=store,DC=domain,DC=local"/>
2.<membership defaultProvider="MyADMembershipProvider">
<providers>
<add name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider,
System.Web,
Version=2.0.0.0, &#xA;             Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADConnectionString"
connectionUsername="domain\Administrator"
connectionPassword="pass@word1"
connectionProtection="Secure" enableSearchMethods="true"
attributeMapUsername="sAMAccountName" minRequiredPasswordLength="7"
applicationName="APP" minRequiredNonalphanumericCharacters="1"/>
</providers>
</membership>
3.<roleManager enabled="true" cacheRolesInCookie="false"
defaultProvider="RoleManagerAzManProvider" cookieTimeout="30"
cookieRequireSSL="false" cookieSlidingExpiration="false"
createPersistentCookie="false" cookieProtection="All" >
<providers>
<add name="RoleManagerAzManProvider"
type="System.Web.Security.AuthorizationStoreRoleProvider, System.Web,
Version=2.0.0.0, &#xA;                    Culture=neutral,
publicKeyToken=b03f5f7f11d50a3a"
connectionStringName="AzManADAMServer"
applicationName="APP"/>
</providers>
</roleManager>
4.<authentication mode="Forms">
<forms loginUrl="Login.aspx" defaultUrl="Default.aspx" timeout="30"
protection="All" requireSSL="false" slidingExpiration="false"
cookieless="UseCookies"/>
</authentication>
5. <authorization>
<deny users="?"/>
</authorization>
Simple Test Page .aspx.

If User.Identity.IsAuthenticated Then

Dim rp As RolePrincipal = CType(User, RolePrincipal)

Dim roleInfo As StringBuilder = New StringBuilder
roleInfo.AppendFormat("<h2>Welcome {0}</h2>",
rp.Identity.Name)
roleInfo.AppendFormat("<b>Provider:</b> {0}<BR>",
rp.ProviderName)
roleInfo.AppendFormat("<b>Version:</b> {0}<BR>",
rp.Version)
roleInfo.AppendFormat("<b>Expires at:</b> {0}<BR>",
rp.ExpireDate)
roleInfo.AppendFormat("<b>Cache List Changed:</b>
{0}<BR>",
rp.CachedListChanged)
roleInfo.AppendFormat("<b>Is role List Cached:</b>
{0}<BR>",
rp.IsRoleListCached)
roleInfo.Append("<b>Roles:</b> ")
Dim roles() As String = rp.GetRoles

For i As Integer = 0 To roles.Length - 1
roleInfo.Append(", ")
roleInfo.Append(roles(i))
Next
Me.Label1.Text = roleInfo.ToString

End If

"Dominick Baier [DevelopMentor]"
<dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4580be63195cca8c7f3ea51721880@xxxxxxxxxxxxxxxxxxxxx

Hi,
ok - i have to look at the source code then.
---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Yes,,

<roleManager enabled="true" cacheRolesInCookie="false"
defaultProvider="RoleManagerAzManProvider" cookieRequireSSL="false"
cookieSlidingExpiration="false" createPersistentCookie="false"
cookieProtection="All" >
<providers>
<add name= xxx />
</providers>
</roleManager>
"Enrique Vargas" <vargasenrique@xxxxxxxxxxx> wrote in message
news:%23Cd1J64IGHA.3064@xxxxxxxxxxxxxxxxxxxxxxx
Hi, I'm using Active Directory as Membership Provider and Azman as
RoleProvider, everything works fine except that any change made in
Azman
after the ASP.NET 2.0 APP is
initialized returns a cached version of the roles information. The
APP
needs to know about any change produced while is running. Any idea
why
Azman is returning a cache version of the roles definitions.Thanks.


.



Relevant Pages

  • Re: C++/CLI Integrating third party assembly into native C++
    ... My app is a large native C++ application. ... have other .NET assemblies that have integrated into the app successfully, ... I get 5 providers returned which is the correct number. ... There's an option "Use hosting process" in the Tools|Options pages ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Azman returns cached roles to .Net API
    ... Dominick Baier - DevelopMentor ... after the ASP.NET 2.0 APP is initialized returns a cached version of the roles information. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Post your name or screen name if you wanna keep Xp alive
    ... You have no influence on MS since we get OS from system ... you do have influence on system providers as far as for their ... If you like your Windows XP you may not have it for long because Microsoft ... or app which most App and Gaming companies will not or have not made the ...
    (microsoft.public.windowsxp.general)
  • Re: Supporting multiple custom RoleProvider versions
    ... providers configured in appilcation web.config file. ... I think we can add as many providers as we want to. ... multiple roleManager providers in my app. ... Gaurav Vaish | http://www.mastergaurav.com ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Azman returns cached roles to .Net API
    ... Dominick Baier - DevelopMentor ... RoleProvider, everything works fine except that any change made in ... after the ASP.NET 2.0 APP is initialized returns a cached version of the roles information. ... The APP needs to know about any change produced while is running. ...
    (microsoft.public.dotnet.framework.aspnet.security)