Show / Hide Table of Contents

Interface ISoContextProvider

Interface that needs to be implemented by plug-ins handling the internal NetServer context. Plug-ins implemented with this interface needs to be mareked with the attribute.

Namespace: SuperOffice.Security.Principal
Assembly: SoCore.dll
Syntax
public interface ISoContextProvider

Properties

InheritSynchronizationContextInThreadManager

Interface that needs to be implemented by plug-ins handling the internal NetServer context. Plug-ins implemented with this interface needs to be mareked with the attribute.

Declaration
bool InheritSynchronizationContextInThreadManager { get; }
Property Value
Type Description
Boolean

Methods

GetCurrentPrincipal()

This method will be called every time the current context is required by anybody in NetServer

Declaration
IPrincipal GetCurrentPrincipal()
Returns
Type Description
IPrincipal

Current principal as required by NetServer.

Remarks

This method might be called from any thread. This means that worker threads will call it in addition to threads held by the application (i.e. IIS).

Implementations can call the IsWorkerThread to check if the thread has been executed by the ThreadManager. This will be the case for all worker threads initiated automatically within NetServer.

SetCurrentPrincipal(IPrincipal)

This method is called every time the current context needs to be stored.

Declaration
void SetCurrentPrincipal(IPrincipal principal)
Parameters
Type Name Description
IPrincipal principal
Remarks

This method will be called when a user authenticates or continues a session.
It will be called with a NULL value when a user closes or suspends his session.

This method might be called from any thread. This means that worker threads will call it in addition to threads held by the application (i.e. IIS).

Implementations can call the IsWorkerThread to check if the thread has been executed by the ThreadManager. This will be the case for all worker threads initiated automatically within NetServer.

It is safe to serialize and de-serialize the value of the context.

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top