System.AppDomain.SetPrincipalPolicy Method

Specifies how principal and identity objects should be attached to a thread if the thread attempts to bind to a principal while executing in this application domain.

Syntax

public void SetPrincipalPolicy (System.Security.Principal.PrincipalPolicy policy)

Parameters

policy
One of the System.Security.Principal.PrincipalPolicy values that specifies the type of the principal object to attach to threads.

Remarks

Setting this value will only be effective if you set it before using the System.Threading.Thread.CurrentPrincipal property. For example, if you set System.Threading.Thread.CurrentPrincipal to a given principal (for example, a generic principal) and then use the AppDomain.SetPrincipalPolicy(System.Security.Principal.PrincipalPolicy) method to set the System.Security.Principal.PrincipalPolicy to System.Security.Principal.PrincipalPolicy.WindowsPrincipal, the current principal will remain the generic principal.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0