Security QuickStart

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

The Security QuickStart application demonstrates some of the key features of the Security Application Block. It demonstrates these features by using a set of walkthroughs, which are implementations of the situations discussed in Key Scenarios. The walkthroughs illustrate the following:

System Requirements

To build and run this QuickStart, you need the following:

  • Microsoft Windows XP Professional, Windows Server 2003, or Windows Vista operating system
  • Microsoft .NET Framework, version 2.0
  • Microsoft Visual Studio 2005 development system

Building and Running the QuickStart

The QuickStart ships as source code, which means you must compile it before running it. You use Visual Studio to build the QuickStart.

To build the Security QuickStart

  1. Ensure the Enterprise Library Source Code has been installed
  2. Open the Enterprise Library Source Code folder from Windows Explorer, or from the Start Menu shortcut: on the taskbar, click Start, point to All Programs, point to Microsoft patterns and practices, point to Enterprise Library 3.1 – May 2007 and select Enterprise Library 3.1 Source Folder.
  3. Open the QuickStarts folder, then Security, then CS (for C#) or VB (for Visual Basic .NET)
  4. Double-click the SecurityQuickStart.sln icon.
  5. Visual Studio opens, displaying the solution file. On the menu, click Build.
  6. Click Rebuild Solution. By default, this is a debug build.
  7. Press F5 to run the QuickStart.

QuickStart Configuration

The walkthroughs in the Security QuickStart are shipped with a defined configuration, which is included in the App.config file. This file is located in the same folder as the QuickStart project file and has the following settings.

Authorization Configuration

Authorization is configured as follows:

  • Name: RuleProvider
  • Type: Authorization Rule Provider
  • Rules:

    Print Document: NOT I:?

    Hire Employee: R:Manager OR R:HumanResources

    Submit New Order: (R:Employee AND (NOT I:Bob))

Security Cache Configuration

The cache is configured as follows:

  • Name: Caching Store Provider
  • AbsoluteExpiration: 60
  • CacheManager: Default Cache Manager
  • SlidingExpiration: 10

Caching Application Block Configuration

The Caching Application Block is configured as follows:

  • Cache managers:

    Name: Default Cache Manager

    ExpirationPollFrequencyInSeconds: 60

    MaximumElementsInCacheBeforeScavenging: 1000

    NumberToRemoveWhenScavenging: 10

To change or view these settings, use the Enterprise Library Configuration Console to open the App.config file in the directory that contains the QuickStart project file. The App.config file contains the configuration data.

Each time you build the code, Visual Studio copies the App.config file to the output directory for the project (the same directory where the QuickStart executable is created), and renames it to SecurityQuickStart.exe.config.

This means that if you want to use the configuration console to change any of the configuration settings—such as the expiration cycle—and you are planning to rebuild the solution, you must change the settings by opening the App.config file located in the QuickStart source directory. You can use the configuration console to open the SecurityQuickStart.exe.config file and change the application configuration. However, these changes will be overwritten during the next successful build.

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.
Show: