This documentation is archived and is not being maintained.
WindowsSecurityToken::Initialize Method (String, DateTime, DateTime, WindowsIdentity, Boolean)
Visual Studio 2010
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.
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.
| Exception | Condition |
|---|---|
| ArgumentNullException | windowsIdentity is nullptr. -or- id is nullptr. |
The Initialize method is called by the constructors for the WindowsSecurityToken class.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: