Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Security.Principal.WindowsIdentity Class Reference

Public Member Functions

 WindowsIdentity (IntPtr userToken)
 
 WindowsIdentity (IntPtr userToken, string type)
 
 WindowsIdentity (IntPtr userToken, string type, WindowsAccountType acctType)
 
 WindowsIdentity (IntPtr userToken, string type, WindowsAccountType acctType, bool isAuthenticated)
 
unsafe WindowsIdentity (string sUserPrincipalName)
 
 WindowsIdentity (SerializationInfo info, StreamingContext context)
 
void Dispose ()
 
override ClaimsIdentity Clone ()
 
virtual void AddClaim (Claim claim)
 
virtual void AddClaims (IEnumerable< Claim?> claims)
 
virtual bool TryRemoveClaim (Claim? claim)
 
virtual void RemoveClaim (Claim? claim)
 
virtual IEnumerable< Claim > FindAll (Predicate< Claim > match)
 
virtual IEnumerable< Claim > FindAll (string type)
 
virtual ? Claim FindFirst (Predicate< Claim > match)
 
virtual ? Claim FindFirst (string type)
 
virtual bool HasClaim (Predicate< Claim > match)
 
virtual bool HasClaim (string type, string value)
 
virtual void WriteTo (BinaryWriter writer)
 
void OnDeserialization (object? sender)
 

Static Public Member Functions

static WindowsIdentity GetCurrent ()
 
static ? WindowsIdentity GetCurrent (bool ifImpersonating)
 
static WindowsIdentity GetCurrent (TokenAccessLevels desiredAccess)
 
static WindowsIdentity GetAnonymous ()
 
static void RunImpersonated (SafeAccessTokenHandle safeAccessTokenHandle, Action action)
 
static T RunImpersonated< T > (SafeAccessTokenHandle safeAccessTokenHandle, Func< T > func)
 
static Task RunImpersonatedAsync (SafeAccessTokenHandle safeAccessTokenHandle, Func< Task > func)
 
static Task< TRunImpersonatedAsync< T > (SafeAccessTokenHandle safeAccessTokenHandle, Func< Task< T > > func)
 

Static Public Attributes

const new string DefaultIssuer = "AD AUTHORITY"
 
const string DefaultNameClaimType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
 
const string DefaultRoleClaimType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role"
 

Protected Member Functions

 WindowsIdentity (WindowsIdentity identity)
 
virtual void Dispose (bool disposing)
 
virtual Claim CreateClaim (BinaryReader reader)
 
virtual void WriteTo (BinaryWriter writer, byte[]? userData)
 

Package Functions

string GetName ()
 

Static Package Functions

static WindowsIdentity GetCurrentInternal (TokenAccessLevels desiredAccess, bool threadOnly)
 

Properties

override? string AuthenticationType [get]
 
TokenImpersonationLevel ImpersonationLevel [get]
 
override bool IsAuthenticated [get]
 
virtual bool IsGuest [get]
 
virtual bool IsSystem [get]
 
virtual bool IsAnonymous [get]
 
override string Name [get]
 
SecurityIdentifierOwner [get]
 
SecurityIdentifierUser [get]
 
IdentityReferenceCollectionGroups [get]
 
SafeAccessTokenHandle AccessToken [get]
 
virtual IntPtr Token [get]
 
virtual IEnumerable< ClaimUserClaims [get]
 
virtual IEnumerable< ClaimDeviceClaims [get]
 
override IEnumerable< ClaimClaims [get]
 
ClaimsIdentityActor [get, set]
 
object? BootstrapContext [get, set]
 
virtual ? byte[] CustomSerializationData [get]
 
List< List< Claim > > ExternalClaims [get]
 
stringLabel [get, set]
 
string NameClaimType [get]
 
string RoleClaimType [get]
 

Private Types

enum  SerializationMask {
  None = 0 , AuthenticationType = 1 , BootstrapConext = 2 , NameClaimType = 4 ,
  RoleClaimType = 8 , HasClaims = 0x10 , HasLabel = 0x20 , Actor = 0x40 ,
  UserData = 0x80
}
 

Private Member Functions

 WindowsIdentity (IntPtr userToken, string authType, int isAuthenticated)
 
 WindowsIdentity ()
 
void CreateFromToken (IntPtr userToken)
 
void ISerializable. GetObjectData (SerializationInfo info, StreamingContext context)
 
void IDeserializationCallback. OnDeserialization (object sender)
 
bool CheckNtTokenForSid (SecurityIdentifier sid)
 
T GetTokenInformation< T > (TokenInformationClass tokenInformationClass)
 
void InitializeClaims ()
 
void AddGroupSidClaims (List< Claim > instanceClaims)
 
void AddPrimarySidClaim (List< Claim > instanceClaims)
 
void AddDeviceGroupSidClaims (List< Claim > instanceClaims, TokenInformationClass tokenInformationClass)
 
void AddTokenClaims (List< Claim > instanceClaims, TokenInformationClass tokenInformationClass, string propertyValue)
 
IEnumerable< Claim > CombinedClaimsIterator ()
 
void SafeAddClaims (IEnumerable< Claim > claims)
 
void SafeAddClaim (Claim claim)
 
void Initialize (BinaryReader reader)
 
bool IsCircular (ClaimsIdentity subject)
 

Static Private Member Functions

static SafeLsaHandle ConnectToLsa ()
 
static unsafe int LookupAuthenticationPackage (SafeLsaHandle lsaHandle, string packageName)
 
static SafeAccessTokenHandle DuplicateAccessToken (IntPtr accessToken)
 
static SafeAccessTokenHandle DuplicateAccessToken (SafeAccessTokenHandle accessToken)
 
static void RunImpersonatedInternal (SafeAccessTokenHandle token, Action action)
 
static void CurrentImpersonatedTokenChanged (AsyncLocalValueChangedArgs< SafeAccessTokenHandle > args)
 
static int GetHRForWin32Error (int dwLastError)
 
static Exception GetExceptionFromNtStatus (int status)
 
static SafeAccessTokenHandle GetCurrentToken (TokenAccessLevels desiredAccess, bool threadOnly, out bool isImpersonating, out int hr)
 
static SafeAccessTokenHandle GetCurrentProcessToken (TokenAccessLevels desiredAccess, out int hr)
 
static global::Interop.LUID GetLogonAuthId (SafeAccessTokenHandle safeTokenHandle)
 
static SafeLocalAllocHandle GetTokenInformation (SafeAccessTokenHandle tokenHandle, TokenInformationClass tokenInformationClass, bool nullOnInvalidParam=false)
 
static string GetAuthType (WindowsIdentity identity)
 

Private Attributes

string _name
 
SecurityIdentifier _owner
 
SecurityIdentifier _user
 
IdentityReferenceCollection _groups
 
SafeAccessTokenHandle _safeTokenHandle = SafeAccessTokenHandle.InvalidHandle
 
readonly string _authType
 
int _isAuthenticated = -1
 
volatile TokenImpersonationLevel _impersonationLevel
 
volatile bool _impersonationLevelInitialized
 
readonly string _issuerName = "AD AUTHORITY"
 
object _claimsIntiailizedLock
 
bool _claimsInitialized
 
List< Claim_deviceClaims
 
List< Claim_userClaims
 
byte[] _userSerializationData
 
ClaimsIdentity _actor
 
string _authenticationType
 
object _bootstrapContext
 
List< List< Claim > > _externalClaims
 
string _label
 
readonly List< Claim > _instanceClaims = new List<Claim>()
 
string _nameClaimType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
 
string _roleClaimType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role"
 

Static Private Attributes

static SecurityIdentifier s_authenticatedUserRid
 
static SecurityIdentifier s_domainRid
 
static SecurityIdentifier s_localSystemRid
 
static SecurityIdentifier s_anonymousRid
 
static bool s_ignoreWindows8Properties
 
static readonly AsyncLocal< SafeAccessTokenHandles_currentImpersonatedToken = new AsyncLocal<SafeAccessTokenHandle>(CurrentImpersonatedTokenChanged)
 

Detailed Description

Definition at line 15 of file WindowsIdentity.cs.


The documentation for this class was generated from the following file: