Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

WindowsSecurityToken.Initialize Method (String, DateTime, DateTime, WindowsIdentity, Boolean)

Initializes a new instance of the WindowsSecurityToken class using the specified unique identifier, Windows user, and the first and last instants in time when the security token is valid.

Namespace:  System.IdentityModel.Tokens
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

protected void Initialize(
	string id,
	DateTime effectiveTime,
	DateTime expirationTime,
	WindowsIdentity windowsIdentity,
	bool clone


Type: System.String

A unique identifier for the security token. Sets the value of the Id property.

Type: System.DateTime

A DateTime that represents the instant in time at which this security token is first valid. Set the value of the ValidFrom property.

Type: System.DateTime

A DateTime that represents the last instant in time at which this security token is valid. Sets the value of the ValidTo property.

Type: System.Security.Principal.WindowsIdentity

A WindowsIdentity that represents a Windows user. Sets the value of the WindowsIdentity property.

Type: System.Boolean

true to create a WindowsIdentity object that is identical to the windowsIdentity parameter and assign that to the WindowsIdentity property; otherwise, assign the value of the windowsIdentity parameter to the WindowsIdentity property.


windowsIdentity is null.


id is null.

The Initialize method is called by the constructors for the WindowsSecurityToken class.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft