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
)

Parameters

id
Type: System.String

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

effectiveTime
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.

expirationTime
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.

windowsIdentity
Type: System.Security.Principal.WindowsIdentity

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

clone
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.

ExceptionCondition
ArgumentNullException

windowsIdentity is null.

-or-

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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft