Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

PISystems Constructor (ClaimsIdentity, Boolean)

  • Last UpdatedNov 18, 2025
  • 2 minute read
PISystems Constructor (ClaimsIdentity, Boolean)
Initializes a new instance of the PISystems collection with for the ClaimsIdentity user with an option to create an independent cache.

Namespace:  OSIsoft.AF
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public PISystems(
	ClaimsIdentity claimsIdentity,
	bool forceNewInstance = false
)
Public Sub New ( 
	claimsIdentity As ClaimsIdentity,
	Optional forceNewInstance As Boolean = false
)

Dim claimsIdentity As ClaimsIdentity
Dim forceNewInstance As Boolean

Dim instance As New PISystems(claimsIdentity, 
	forceNewInstance)
public:
PISystems(
	ClaimsIdentity^ claimsIdentity, 
	bool forceNewInstance = false
)
new : 
        claimsIdentity : ClaimsIdentity * 
        ?forceNewInstance : bool 
(* Defaults:
        let _forceNewInstance = defaultArg forceNewInstance false
*)
-> PISystems

Parameters

claimsIdentity
Type: System.Security.ClaimsClaimsIdentity
Identity to use when initializing instance.
forceNewInstance (Optional)
Type: SystemBoolean
Set to to force the creation of an independent collection of PISystems for the current user with a separate cache.

Examples

ClaimsIdentity testAccountIdentity = new ClaimsIdentity();
testAccountIdentity = new ClaimsIdentity();
testAccountIdentity.AddClaim(new Claim("id", TestAccountName));
testAccountIdentity.AddClaim(new Claim("access_token", TestAccountAccessToken));

PISystems myPISystems = new PISystems(testAccountIdentity);

PISystem piSystem = myPISystems.DefaultPISystem;
piSystem.Connect();
Console.WriteLine("CurrentUserName = {0}", piSystem.CurrentUserName);
Console.WriteLine("AuthenticationType = {0}", piSystem.ConnectionInfo.AuthenticationType);
Console.WriteLine();

piSystem = myPISystems[AFServerMachine2];
piSystem.Connect();
Console.WriteLine("CurrentUserName = {0}", piSystem.CurrentUserName);
Console.WriteLine("AuthenticationType = {0}", piSystem.ConnectionInfo.AuthenticationType);
Console.WriteLine();

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0

See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in