Class AccountId
An identifier for an account in a specific tenant. Returned by IAccount.HomeAccountId
public class AccountId
- Inheritance
-
AccountId
- Inherited Members
Constructors
AccountId(string)
Constructor of an AccountId meant for Active Directory Federation Services (ADFS) scenarios since ADFS instances lack tenant IDs.
public AccountId(string adfsIdentifier)
Parameters
adfsIdentifier
stringUnique identifier for the account if authority is ADFS.
AccountId(string, string, string)
Constructor for an account ID.
public AccountId(string identifier, string objectId, string tenantId)
Parameters
identifier
stringUnique identifier for the account.
objectId
stringA string representation for a GUID which is the ID of the user owning the account in the tenant.
tenantId
stringA string representation for a GUID which is the ID of the tenant where the account resides.
Properties
Identifier
Unique identifier for the account
public string Identifier { get; }
Property Value
Remarks
For the Microsoft identity platform (formerly named Azure AD v2.0), the identifier is the concatenation of
ObjectId and TenantId separated by a period.
Unlike in ADAL.NET, these two segments are no longer base64-encoded.
Note that there are some legitimate cases (for instance domain takeover) where the same ObjectId
may show up in multiple tenants.
ObjectId
For Microsoft Entra ID, a string representation for a GUID which is the object ID of the user owning the account in the tenant
public string ObjectId { get; }
Property Value
TenantId
For Microsoft Entra ID, a string representation for a GUID which is the ID of the tenant where the account resides.
public string TenantId { get; }
Property Value
Methods
Equals(object)
Two accounts are equal when their Identifier properties match.
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetHashCode()
GetHashCode implementation to match Equals(object).
public override int GetHashCode()
Returns
ToString()
Textual description of an AccountId.
public override string ToString()