C# Class NContext.Security.SecurityManagerBuilder

Defines a configuration class to build the application's SecurityManager.
Inheritance: ApplicationComponentConfigurationBuilderBase
Show file Open project: PowerDMS/NContext

Public Methods

Method Description
SecurityManagerBuilder ( ApplicationConfigurationBuilder applicationConfigurationBuilder ) : System

Initializes a new instance of the SecurityManagerBuilder class.

SetCacheProviderName ( String cacheProviderName ) : SecurityManagerBuilder
SetTokenExpirationPolicy ( System.TimeSpan expiration, System.Boolean isAbsolute = false ) : SecurityManagerBuilder

Sets the security token expiration policy. When used with SecurityManager.SavePrincipal, SecurityManager will cache the IPrincipal instance that is associated with the token. Subsequent calls to SecurityManager.GetPrincipal will return the cached IPrincipal. By default security tokens / principals do not expire. By setting an expiration value, the token will expire from cache. If isAbsolute is false, then the cache entry will be evicted if it has not been accessed in the given span of time (expiration). If isAbsolute is true, then the cache entry will be evicted after a specified duration (the DateTime the cache entry was created + expiration).

Protected Methods

Method Description
Setup ( ) : void

Sets the application's security manager using the configuration created from this instance.

Method Details

SecurityManagerBuilder() public method

Initializes a new instance of the SecurityManagerBuilder class.
public SecurityManagerBuilder ( ApplicationConfigurationBuilder applicationConfigurationBuilder ) : System
applicationConfigurationBuilder ApplicationConfigurationBuilder The application configuration.
return System

SetCacheProviderName() public method

public SetCacheProviderName ( String cacheProviderName ) : SecurityManagerBuilder
cacheProviderName String
return SecurityManagerBuilder

SetTokenExpirationPolicy() public method

Sets the security token expiration policy. When used with SecurityManager.SavePrincipal, SecurityManager will cache the IPrincipal instance that is associated with the token. Subsequent calls to SecurityManager.GetPrincipal will return the cached IPrincipal. By default security tokens / principals do not expire. By setting an expiration value, the token will expire from cache. If isAbsolute is false, then the cache entry will be evicted if it has not been accessed in the given span of time (expiration). If isAbsolute is true, then the cache entry will be evicted after a specified duration (the DateTime the cache entry was created + expiration).
public SetTokenExpirationPolicy ( System.TimeSpan expiration, System.Boolean isAbsolute = false ) : SecurityManagerBuilder
expiration System.TimeSpan The expiration time span.
isAbsolute System.Boolean The method which to use for evicting cached token / principals.
return SecurityManagerBuilder

Setup() protected method

Sets the application's security manager using the configuration created from this instance.
protected Setup ( ) : void
return void