Using netsqlazman as roleprovider and caching

Topics: NetSqlAzMan Core
May 17, 2011 at 4:46 PM
Edited May 17, 2011 at 4:49 PM

I plan to use netsqlazman as a RoleProvider in a .net web app.

Is there a interval of time after which the role <-> users/groups mappings expire?

Let's say we have the following scenario: User UA has role RA, UA logs in, then using the netsqlazman console I (as administrator) assign UA role RB, when does this role assignment become effective within the application? Does the user have to log off and then log back in? It doesn't seem to work.

As a side note, in the final version will assign NT groups to roles and the mappings will be pretty static.  I am also interested to find out, if, in such scenarios, removing a user from a group will reflect immediately in the roles mapping that will be assigned to that user.



May 17, 2011 at 7:06 PM

This seems to do the trick:

NetSqlAzMan.Providers.NetSqlAzManRoleProvider provider = ((NetSqlAzMan.Providers.NetSqlAzManRoleProvider)Roles.Provider);

May 18, 2011 at 5:32 PM



Andrea Ferendeles
NetSqlAzMan Project Coordinator
E-mail Web

Oct 29, 2013 at 3:14 PM
Hi Andrea,

I tried to implement the cacheRefreshInterval inside of the providers section but It looks that this is not implemented in the NetSqlAzMan.

take a look of this:

It will be nice if we can use the cacheRefreshInterval="number" in the role provider instance.

Thanks in Advance.
Oct 30, 2013 at 8:07 AM
Edited Oct 30, 2013 at 8:07 AM
the cacheRefreshInterval is an "AuthorizationStoreRoleProvider" property exclusive.
It cannot be implemented in any custom provider.

Look at the cacheRefreshInterval Property description in your URL:

"Specifies the number of minutes between forced updates of the cached policy store data and Applies to the AuthorizationStoreRoleProvider only."

Oct 30, 2013 at 1:27 PM
Hi Andrea,
Thanks a lot for your prompt response and for this wonderful NetSQLAzMan product.

I was looking that the NetSqlAzManRoleProvider class inherit from the System.Web.Security.RoleProvider in the same way that the AuthorizationStoreRoleProvider class inherit also from the System.Web.Security.RoleProvider but this class implement the property CacheRefreshInterval.

I’m not sure but maybe it is a good Idea to implement this property and have a Timer that uses this property, something like this:
// Validate the property CacheRefreshInterval on the Initialize method.
   if (!string.IsNullOrEmpty(config["CacheRefreshInterval"]))
                int i = 0;
                bool failure = int.TryParse(config["CacheRefreshInterval"], out i);
                this.CacheRefreshInterval = i;

if (this.CacheRefreshInterval > 0)
// Create a timer.
        aTimer = new System.Timers.Timer();

// Hook up the Elapsed event for the timer.
        aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);

// Set the Interval.
        aTimer.Interval = (this.CacheRefreshInterval * 1000);
        aTimer.Enabled = true;

// Specify what you want to happen when the Elapsed event is raised. 
    private void OnTimedEvent(object source, ElapsedEventArgs e)
Thank You.

Best Regards.