Click or drag to resize

SecurityModule Class

Represents an HTTP module that can be used to enable site-wide role-based security.
Inheritance Hierarchy
SystemObject
  GSF.WebSecurityModule
    GSF.WebIgnoreServicesSecurityModule

Namespace: GSF.Web
Assembly: GSF.Web (in GSF.Web.dll) Version: 2.4.207-beta
Syntax
public class SecurityModule : IHttpModule
View Source

The SecurityModule type exposes the following members.

Constructors
 NameDescription
Public methodSecurityModuleInitializes a new instance of the SecurityModule class
Top
Properties
 NameDescription
Protected propertyApplication Gets the current HttpApplication instance.
Top
Methods
 NameDescription
Public methodDispose Releases the resources used by SecurityModule.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Protected methodGetResourceName Gets the name of resource being accessed.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodInit Initializes the SecurityModule.
Protected methodIsAccessRestricted Determines if access to the requested resource is restricted by RestrictAccessAttribute.
Protected methodIsAccessSecured Determines if access to the requested resource is to be secured.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Protected methodRedirect Redirects the client browser based on the specified httpStatusCode
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Example
Required config file entries:
C#
<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="categorizedSettings" type="GSF.Configuration.CategorizedSettingsSection, GSF.Core" />
  </configSections>
  <categorizedSettings>
    <securityProvider>
      <add name="ApplicationName" value="" description="Name of the application being secured as defined in the backend security datastore."
        encrypted="false" />
      <add name="ConnectionString" value="" description="Connection string to be used for connection to the backend security datastore."
        encrypted="false" />
      <add name="ProviderType" value="GSF.Security.LdapSecurityProvider, GSF.Security"
        description="The type to be used for enforcing security." encrypted="false" />
      <add name="IncludedResources" value="*/*.*=*" description="Semicolon delimited list of resources to be secured along with role names."
        encrypted="false" />
      <add name="ExcludedResources" value="*/WebResource.axd*;*/SecurityPortal.aspx*"
        description="Semicolon delimited list of resources to be excluded from being secured."
        encrypted="false" />
      <add name="NotificationSmtpServer" value="localhost" description="SMTP server to be used for sending out email notification messages."
        encrypted="false" />
      <add name="NotificationSenderEmail" value="sender@company.com" description="Email address of the sender of email notification messages." 
        encrypted="false" />
    </securityProvider>
    <activeDirectory>
      <add name="PrivilegedDomain" value="" description="Domain of privileged domain user account."
        encrypted="false" />
      <add name="PrivilegedUserName" value="" description="Username of privileged domain user account."
        encrypted="false" />
      <add name="PrivilegedPassword" value="" description="Password of privileged domain user account."
        encrypted="true" />
    </activeDirectory>
  </categorizedSettings>
  <system.web>
    <authentication mode="Windows"/>
    <httpModules>
      <add name="SecurityModule" type="GSF.Web.SecurityModule, GSF.Web" />
    </httpModules>
  </system.web>
</configuration>
See Also