What's new in ASP.NET 2.0 in terms of Authorization?

From Guidance Share

Jump to: navigation, search

J.D. Meier, Prashant Bansode, Alex Mackman

Answer

ASP.NET 2.0 introduces Role Manager, which provides an API and provider model to manage roles in an underlying role store database.

Role Manager supports a provider model. The following providers are supported:

  • WindowsTokenRoleProvider for Windows groups maintained in AD
  • SqlRoleProvider for role stores in SQL Server databases
  • AuthorizationStoreRoleProvider for roles held in an AzMan policy role store including Active Directory Application Mode (ADAM) and XML data stores.

The provider model is extensible and you can create custom providers for your custom role stores. The Role Manager API provides methdods including CreateRole, AddUserToRole, IsUserInRole etc for roles management and roles authorization.

Additionally ASP.NET 2.0 role manager supports role caching, where role names are cached in the role cookie. You can configure role manager to cache roles read from the roles store for a user and reuses them on subsequent roles checks. This can help to improve performance by reducing the number of times the role store needs to be accessed.

Role manager is not enabled by default. Therefore, before you can use the Role manager you need to explicitly enable it in your application's Web.config file.

  <roleManager enabled="true" />

More Information

For more information on using Role manager, see “How To: Use Role Manager in ASP.NET 2.0” at http://msdn.microsoft.com/library/en-us/dnpag2/html/PAGHT000013.asp

Personal tools